Now the thing is you have nine buttons but you dont know how to assign X or O for the players. I would suggest a solution like this. You have two players (A,B) and if A starts first, for the entire game he’s going to go with label ‘X’ for his turns. For the other it’s ‘O’. You will have to mark your 9 buttons according to which player clicked it. Ex:- If ‘A’ clicked ‘button5’ then the button label should be turned to ‘X’. likewise until all the buttons get clicked or someone wins the game continues. I only gave you the guidance. Come up with this implementation and let’s resolve any new problems you have.
2
solved tic tac toe andrdoid studio