A collection of Python scripts showcasing various games, built as exercises to explore and enhance programming skills with Python. This repository currently includes:
- Tic Tac Toe: The classic grid-based strategy game for two players.
- La Bataille: A traditional French card game for two players.
- Stay tuned for more games in the future!
- Tic Tac Toe
- Features
- How to Play
- Example Gameplay
- La Bataille
- Rules
- How to Play
- Example Gameplay
- File Structure
- Roadmap
- Requirements
- Contributing
- License
- Acknowledgments
A simple, interactive implementation of the classic Tic Tac Toe game in Python. This project is designed to be beginner-friendly, with clear and concise code that showcases fundamental programming concepts.
- Two-player gameplay.
- Automatic winner and draw detection.
- Input validation to ensure fair play.
- Lightweight and terminal-based.
- Clone the repository and navigate to the directory:
git clone https://github.com/your-username/games.git cd games
- Run the Tic Tac Toe game:
python tic_tac_toe.py
- Follow the prompts to take turns entering the row and column numbers (0-2) to place your mark.
An implementation of the traditional French card game La Bataille in Python. This project demonstrates concepts like shuffling, list manipulation, and loops.
- The game is played with a standard 52-card deck, divided equally between two players.
- Players reveal the top card of their deck simultaneously:
- The player with the higher card value wins the round and takes both cards.
- If the cards are of equal value, a Bataille (battle) occurs:
- Each player places three cards face down, then reveals a fourth card.
- The higher fourth card wins all the cards from the round.
- If there's another tie, the battle continues in the same way.
- The game continues until one player has all the cards or a predefined number of rounds is reached.
- Run the La Bataille game:
python la_bataille.py
- The program shuffles and distributes the cards automatically.
- Players take turns revealing cards, and the game announces the winner of each round.
- The game ends when one player has all the cards, or the maximum number of rounds is reached.
Joueur 1 a joué ('2', 'COEUR')
Joueur 2 a joué ('7', 'CARREAU')
Joueur 2 gagne ce tour
-----
Joueur 1 a joué ('10', 'CARREAU')
Joueur 2 a joué ('Dame', 'TREFLE')
Joueur 2 gagne ce tour
games/
│
├── tic_tac_toe.py # Tic Tac Toe implementation
├── la_bataille.py # La Bataille implementation
├── requirements.txt # Dependencies (if any)
└── README.md # Documentation
Upcoming features and games:
- A single-player Tic Tac Toe mode with an AI opponent.
- Additional card games like Le Président
- A leaderboard feature to track scores across games.
- A web-based interface to play games online.
- Python 3.x
- No external dependencies are currently required.
Contributions are welcome! Here's how you can help:
- Fork the repository.
- Add your new feature or game in a separate branch.
- Open a Pull Request for review.
This repository is licensed under the MIT License.
Special thanks to all the creators of Python tools and resources that made this possible. Feel free to reach out with feedback or ideas for new games. 😊