I post a piece of sample code from one of the solutions to LongLongNim

for(i = 0; i < moves.size(); i++) mmask |= 1 << moves[i] - 1;for(i = 0; i < 1 << 22; i++) x[i] = (i << 1 & 0x3FFFFF) + (((mmask & i) != mmask) ? 1 : 0);

What I cant understand is the theory behind "mmask & i". Why are we doing this?

As far as I understand from the tutorial, the requirements for a game to be winning or losing are based on some simple rules - how are those translated to this algorithm?

thanks in advance]]>