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.
git clone https://github.com/shrawani21/gamer_21.git
cd gamer_21
pip install -r requirements.txt
or
pip install pygame
python main.py
This will launch the game!
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
git remote add upstream https://github.com/shrawani21/gamer_21.git
git remote -v
git pull upstream main
git checkout -b <YOUR_BRANCH_NAME>
Perform your desired changes to the code base.
Check your changes.
git status
git diff
git add . <\files_that_you_made_changes>
git commit -m "relavant message"
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