Odd Even Cricket is a fun and simple Python game where you play a virtual game of cricket against the computer. The game involves choosing between "Odd" or "Even" and then picking a number between 1 and 10. The computer also picks a number, and the game progresses based on the outcome.
- Toss simulation with odd/even choice.
- Batting and bowling phases for both player and computer.
- Dynamic scoring with random number generation.
- Immediate game end when the target is reached.
- Option to replay the game after it ends.
To install the Odd Even Cricket Game, simply use pip:
pip install OddEvenGame
After installation, you can start playing the game by importing the package and calling the start()
function.
import oddevengame
oddevengame.start()
- Toss: Choose "Odd" or "Even" and pick a number between 1 and 10. The computer does the same, and the sum determines the winner of the toss.
- Batting/Bowling: Depending on the toss result, either you or the computer will bat first. The game will then simulate each inning, with the goal being to outscore the opponent.
- Winning: The game automatically ends when one player surpasses the other's score, and a winner is declared.
- Replay Option: After the game ends, you will be asked if you want to play again.
- Python 3.8 or higher
This project is licensed under the MIT License.
Developed by Siddharth Yadav.