Dot and Boxes is a classic pen-and-paper game where two players take turns connecting dots to form lines. When a player completes a box by forming the fourth side, they score a point and get another turn. The player with the most boxes at the end of the game wins.
- Grid-based Gameplay: The game consists of a grid where players take turns to draw lines between dots.
- Two Players: The game supports two players, either two human players taking turns.
- Turn-based System: The game alternates turns between the players unless a player completes a box, in which case they get an extra turn.
- Score Tracking: Keep track of each player's score throughout the game.
-
Player 1 is represented by 'X' and Player 2 is represented by 'O'.
-
Use the arrow keys to draw lines:
-
Up Arrow: Draw the top line of the selected cell.
-
Right Arrow: Draw the right line of the selected cell.
-
Down Arrow: Draw the bottom line of the selected cell.
-
Left Arrow: Draw the left line of the selected cell.
or you can also use the mouse to select cells by clicking on them.
-
-
When a player completes the fourth side of a box, they earn a point and get an additional turn.
-
The game ends when all the boxes are completed. "Game Over" message will be displayed
-
Press the 'R' key to restart the game at any time.
-
Press 'Q' or the 'Escape' key to quit the game.
- Clone the repository to your local machine:
git clone https://github.com/shrawani21/gamer_21.git
- Navigate to the project directory:
cd gamer_21
- Install dependencies/requirements:
or
pip install -r requirements.txt
pip install pygame
- Run the Game:
This will launch the game!
python main.py
If you think that you can add a new feature or want to fix a bug, we invite you to contribute to gamer_21 and make this project better.
To start contributing, follow the below instructions:
-
Create a folder in your system where you want to save the files.
-
Open Git Bash there.
-
Create a Git repository. Run command
git init
-
Fork the repository.
-
Clone your forked repository of project.
git clone https://github.com/<your_username>/gamer_21.git
- Navigate to the project directory.
cd gamer_21
- Add a reference(remote) to the original repository.
git remote add upstream https://github.com/shrawani21/gamer_21.git
- Check the remotes for this repository.
git remote -v
- Always take a pull from the upstream repository to your main branch to keep it updated as per the main project repository.
git pull upstream main
- Create a new branch(prefer a branch name that relates to your assigned issue).
git checkout -b <YOUR_BRANCH_NAME>
-
Perform your desired changes to the code base.
-
Check your changes.
git status
git diff
- Stage your changes.
git add . <\files_that_you_made_changes>
- Commit your changes.
git commit -m "relavant message"
- Push the committed changes in your feature branch to your remote repository.
git push -u origin <your_branch_name>
-
To create a pull request, click on
compare and pull requests
. -
Add an appropriate title and description to your pull request explaining your changes.
-
Click on
Create pull request
.
Congratulations🎉, you have made a pull request to the Gamer_21. Wait for your submission to be accepted and merged.
-python -pygame
- This project is based on the classic Dot and Boxes game.
- Developed using Python only.
- This project is licensed under the MIT License.