A modern, responsive Tic-Tac-Toe game built with React and Redux, featuring an intelligent AI opponent with multiple difficulty levels and a beautiful dark/light theme toggle.
- Smart AI opponent with three difficulty levels
- Beautiful dark/light theme toggle
- Choose your symbol (X or O)
- Undo move functionality
- Fully responsive design
- Game state persistence
Try it out: Minimalistic Tic-Tac-Toe Game
Start by choosing your preferred symbol (X or O). The AI will take the opposite symbol.
Make strategic moves and try to outsmart the AI! The game features a smart AI opponent that adapts to different difficulty levels.
Experience the thrill of victory or the challenge of defeat! The game keeps track of your progress and AI difficulty adjustments.
- Node.js (version 14 or higher)
- npm or yarn
- Clone the repository
git clone https://github.com/FrancisBernard34/tic-tac-toe-game.git- Navigate to the project directory
cd tic-tac-toe-game- Install dependencies
npm install- Start the development server
npm startThe game will open in your default browser at http://localhost:3000.
- React - UI library
- Redux Toolkit - State management
- Sass - Styling
- Create React App - Build setup
- Jest & React Testing Library - Testing
The game includes a comprehensive test suite built with Jest and React Testing Library. The tests cover:
- Game initialization and setup
- Player and AI moves
- Win/loss/draw conditions
- Game controls (reset, undo, theme toggle)
- Edge cases and invalid moves
Run the tests with:
npm test-
AI Difficulty Levels:
- Easy: Makes random moves
- Medium: Blocks winning moves
- Hard: Uses minimax algorithm for optimal play
-
Theme Toggle: Switch between light and dark themes for comfortable gaming in any lighting condition
-
Responsive Design: Perfectly playable on any device, from mobile phones to desktop computers
-
Game State: Automatically saves your progress and preferences
Contributions are welcome! Feel free to open issues and submit pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Francis Bernard
- GitHub: @FrancisBernard34


