This Tic-Tac-Toe game consists of both the versions of the game,i.e, the normal tic-tac-toe game with fixed grid length(total cells) of 9 and 3 symbols are required to match either horizontally,vertically or diagonally to win this game , and the Open-Field Tic-Tac-Toe game where the grid size and the length of consecutive symbols to match(win length) is user defined. The entire code is written in Python and Tkinter library is used for the GUI of the game.
To run the game simply run the game.py file in your terminal using the commmand "python3 game.py". You will see a messagebox-type screen with yellow background containing the following buttons:-
This button restarts the game from beginning aborting the current game.
For starting the game using this button,you must provide the grid size and the win length as input in the respective textboxes.
This button decides the symbol to used by the player(either 0 or X).
This button is used to start the game with default settings.
This button toggles between different AI options deciding the type of AI Algorithm to be used.
- To start normal Tic-Tac-To game,just click on the Fixed Grid button.It will show a screen with 9 blocks/cells and 3 symbols are required to match vertically,horizontally or diagonally to win the game.
- To play Open-Field Tic-Tac-Toe game,you should first provide the grid size you want and the win length,i.e. and the length of consecutive symbols to match to win the game, in the respective text-boxes.Then click on "Start Game" button to begin the game. You can change the type of AI algorithm to be used by the toggle button appearing on the left side of the window as vs Player/vs Easy AI/vs Normal AI/vs Hard AI.The algorithm used in hard AI is more complex than that in the normal AI and the easy AI which makes the computer play most optimally. To have a look at me playing the game visit :- https://youtu.be/576PDlKSs3k