This is a simple Tic Tac Toe game implemented in HTML, CSS, and JavaScript.
This was generated while testing out aider with Gemini and Grok AI, Gemini started it, Grok fixed it, and added minimax correctly. Gemini for the README.md and code cleanup.
- Multiple Game Modes: Supports Computer vs. Computer, Player vs. Computer, and Player vs. Player modes.
- Player Names: Allows players to enter their names (except in Computer vs. Computer mode).
- Alphanumeric Input: Validates player names to allow only alphanumeric characters, spaces, and underscores.
- Responsive Design: The game board is designed to be responsive and adapt to different screen sizes.
- Computer AI: Implements a Minimax algorithm for the computer's moves, providing a challenging opponent.
- Clear UI: Provides a clean and intuitive user interface.
- Open the
tictactoe.htmlfile in your web browser. - Select the desired game mode (Computer vs. Computer, Player vs. Computer, or Player vs. Player).
- If you selected Player vs. Computer or Player vs. Player, enter the player names and click "Start Game".
- Click on an empty cell to make your move.
- The game will automatically check for a winner or a draw after each move.
- Click "Play Again" to start a new game with the same settings.
- Click "Change Options" to return to the game mode selection screen.
- HTML
- CSS
- JavaScript
The Computer vs. Computer and Player vs. Computer modes use the Minimax algorithm to determine the best move for the AI player. The algorithm explores all possible game states to a certain depth and chooses the move that maximizes the AI's chances of winning.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Jeffrey B. McGough - @jmcgough
Initial work and project creator
- This project was developed with assistance from:
- Grok, an AI created by xAI.
- Gemini 2.0 Flash - For additional AI support.
- Aider - An AI-powered coding assistant.