you could use something like BOOL turn=false; //false => Player1 has to set his marker; true for Player2 if you click at the board you can chekc the value of "turn": if(turn==false){change board piece to X;turn =true;} else{change it to O; turn=false;}