Video Demo: https://youtu.be/KM_Tcb1YbcI
Disclaimer: This project is made to fulfill the requirements of CS50P Certificate
Welcome to Endless tic-tac-toe, a twist on the classic tic-tac-toe game where you can only have max of 3 marks on the game board! This game allows players to continuously play by relocating their moves once they have filled their move queue. It's a fun and strategic variation that keeps players engaged and thinking several steps ahead.
Endless tic-tac-toe follows the basic rules of traditional tic-tac-toe with an added twist. Here’s how it works:
- Objective: The objective of the game is to be the first to get three of your marks in a row (vertically, horizontally, or diagonally).
- Turn Order: The game starts with either the player or the computer, depending on the player's choice of 'X' or 'O'. 'O' always goes first.
- Relocation: Each player has a move queue that can hold up to three moves. When the queue is full, the oldest move is relocated to a new position chosen by the player.
- Winning: The game checks for a win after every move. A win is declared if a player manages to place three of their marks in a row, column, or diagonal.
- Camping: You can't choose to put at the same location of the mark that need to relocate. This is known as camping. Be smart and strategize your move!
- Interactive Gameplay: The game offers an interactive gameplay experience where players can continuously play without restarting.
- Computer Opponent: Players can compete against a computer opponent with random move selection.
- Move Queue: Players and the computer each have a move queue that adds strategic depth to the game.
- Win Detection: The game automatically checks for win conditions after each move and announces the winner.
- Start the Game: Run the main script to start the game.
- Choose Your Mark: When prompted, choose either 'X' or 'O'. 'O' goes first.
- Player's Turn: Input the number of the tile where you want to place your mark.
- Computer's Turn: The computer will randomly select an available tile for its mark.
- Relocate Moves: Once your move queue is full (after three moves), you will need to relocate your oldest move to a new tile.
- Win Condition: The game will automatically check for a win after each move. If you get three of your marks in a row, column, or diagonal, you win!
To install and run Endless tic-tac-toe, follow these steps:
-
Clone the Repository: Clone the project repository from GitHub to your local machine.
git clone https://github.com/tasyadew/endless-tic-tac-toe.git cd endless-tic-tac-toe
-
Dependencies: Ensure you have Python installed on your machine. The game uses standard libraries such as
random
,time
, andqueue
.pip install -r requirements.txt
-
Run the Game: Execute the main script to start the game.
python main.py
Here are some potential improvements and additional features that could be added to Endless tic-tac-toe:
- Enhanced AI: Improve the computer opponent’s strategy using more advanced algorithms.
- Multiplayer Mode: Add a multiplayer mode to allow two players to compete against each other.
- Graphical Interface: Develop a graphical user interface (GUI) to make the game more visually appealing and user-friendly.
- Difficulty Levels: Implement different difficulty levels for the computer opponent to cater to players of varying skill levels.
- Move History: Display a history of moves for players to review their strategy.
- Sound Effects: Add sound effects to enhance the gaming experience.
Endless tic-tac-toe offers an engaging and strategic twist on the classic game. With continuous gameplay and the added challenge of managing a move queue, it provides a fresh and exciting experience for players. Whether you are competing against a computer opponent or strategizing your next move, Endless tic-tac-toe is sure to provide hours of entertainment. Enjoy the game and may the best player win!