// if both 1 and 0 are valid then something went wrong
if(validForZero&&validForOne)
returnnull;
// change the specifided place in a 0 or 1 if they are valid. if both are not valid then there is no valid move on the checked space and null is returnd.
if(validForZero)
result[x,y]=0;
elseif(validForOne)
result[x,y]=1;
else
returnnull;
returnresult;
}
// check if the space is surrounded on both sides by the same number. If it is, the checked space should be the opposite number
// every row and colom should have an even number of 1's and 0's. So if the total number of 1's in a row is equal to half the with of the row a 0 should be filled in.