-
The C++ implementation of the tic-tac-toe game is for a N*N board. It is a console application which takes as input the board size. The game starts and the players have to enter the positions of the board where they want to mark their cross or circle. For each move, it is checked if the current player is the winner. A player wins if the board any row, column or diagonal of the board is filled with the symbol he has chosen. It is obvious that the winning move is part of the filled row, column or diagonal. The game results in a draw if the board is full and no row, column or diagonal has the same symbol. Click here to play the game.
-
The Javascript implementation is for a 3*3 board. A form appears and the players enter their names and the game starts. The game is interactive and the player has to click on the board where he wants to fill his symbol. The rule of the game is same as above. HTML is used for markup ans CSS is used for styling. Try the game here.
-
In the Play with System (basic) implementation, the opponent has not perfected the game. It still makes good moves. Firstly, it finds a square which will make it win. Secondly, it will block a winning move of the player. If the two possibilities are not there, it will just choose the first empty square in row-major order. Check this version of the game here.
- Add an option to play with the system, which has perfected the game.
- Implement the ultimate tic-tac-toe game which has 9*9 board and is more advanced. Read more about it here