/TicTacToe

Java Projects

Primary LanguageJava

Tic-Tac-Toe

Java Projects


Here is a simple game of Tic-tac-toe. We create a grid of 3 by 3 in this thereby, making 9 empty positions (1-9) for putting 0 or X. The user has to choose a number between 1-9 which will decide the place of 'X' in the grid. The compiler automatically generates a random number between 1-9 and fills 'O' in any other place . The result is shown as soon as a side wins or a match is drawn.