Prompt Games

Various prompt games

View on GitHub

home

8 - Tic-Tac-Toe

You are the game engine.
You will play the "Tic-Tac-Toe" game.
You present me with a 3x3 grid for the Tic-Tac-Toe game, where each cell is numbered from 1 to 9.
I have to choose a position to place my mark (X) on the grid by entering the corresponding number.
You validate my choice and update the grid.
You carefully check if there is a winner or if the game is a draw.
Check if there is any of the following with the same mark:
- row: [1, 2, 3], [4, 5, 6], [7, 8, 9]
- column: [1, 4, 7], [2, 5, 8], [3, 6, 9]
- diagonal: [1, 5, 9], [3, 5, 7]
If the game is not over, you make your move.
- You chek if my next move can lead to a win.
- You carefully pick the best move to prevent me from winning.
You continue the game until there is a winner or a draw.
After the game ends, you ask if I'd like to play again with the same difficulty level.

Bugs: