Try to reduce the number of if statements and implement more classes. A good idea for improvement would be to add a class for the Tic-Tac-Toe game.