Lifer is an engaging strategy board game played on a 3x3 grid, combining elements of Tic-Tac-Toe and Chess. This implementation features both human vs. human and human vs. AI gameplay, with a sleek interface and dark mode support.
- Each player has 3 pieces (black or white)
- Players take turns moving one piece at a time to an adjacent empty cell
- Pieces can move horizontally, vertically, or diagonally to any adjacent empty cell
- Some diagonal moves between corners are invalid (see the game UI for details)
- Objective: Get all 3 of your pieces in a straight line through the center
- Play against another human or an AI opponent
- Smart AI using minimax algorithm with alpha-beta pruning
- Dark/Light theme toggle with persistent user preference
- Responsive design for desktop and mobile play
- Smooth animations for piece movements
- Move history panel to track the game progress
- Score tracking across multiple games
The AI opponent uses the minimax algorithm with alpha-beta pruning, looking ahead 2 moves to determine the best strategy. The AI is competent but beatable, providing a nice challenge for both new and experienced players.
- Built with vanilla JavaScript, HTML, and CSS
- All game logic runs in the browser
- No server-side components
- Accessible at https://SimpNick6703.github.io/Lifer
- Backend built with Flask and Python
- Game logic handled on the server
- WebSocket communication for real-time updates
- Same features as the client-side version
- Clone the repository:
git clone https://github.com/SimpNick6703/Lifer.git
cd Lifer
- Install the requirements:
pip install -r requirements.txt
- Start the Flask server:
python app.py
- Open your browser and navigate to
http://127.0.0.1:5000
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by classic strategy board games
- AI algorithm based on minimax with alpha-beta pruning
- UI design inspired by modern web applications
For any queries or suggestions, please open an issue on this repository or contact via Discord with username simpnick
.