Welcome to my Cricket Game Simulation project! This is my first programming project, where Iβve created a fun and interactive simulation of a cricket game using C++.
- Simulates a complete cricket match between two customizable teams.
- Allows users to:
- Input team names and select players.
- Decide match parameters like overs and player roles.
- Simulate toss decisions and innings.
- Tracks key stats:
- Runs, wickets, extras, and overs.
- Individual player performances (runs scored, wickets taken, strike rate, economy).
- Generates a detailed match summary saved in a
matchsummary.txt
file. - Simple and intuitive console-based interface.
- Team Setup:
- Input team names and player details.
- Match Settings:
- Specify the number of overs and simulate the toss.
- Gameplay:
- Input ball-by-ball actions such as runs, wickets, or extras.
- Real-time score updates and player statistics.
- Match Result:
- View the match summary, including top batsmen, bowlers, and the winner.
- Programming Language: C++
- Libraries:
<iostream>
: For input and output.<fstream>
: For saving match summaries.<string>
: For managing player names and team data.
- Clone this repository: https://github.com/codifyhuzaifa/CEP.git
- Navigate to the project directory: cd CEP
- Compile the code using a C++ compiler: g++ cricket_game.cpp -o cricket_game
- Run the program: ./cricket_game
- Follow the prompts in the console to set up the match.
- Input ball-by-ball events (e.g., runs, wickets, extras).
- At the end of the match, check the console output and
matchsummary.txt
for detailed results.
0
: Dot ball1
: Single run4
: Boundary (Four)6
: Six7
: Wicket8
: No Ball (Free Hit)9
: Wide Ball
- Adding advanced cricket rules like powerplays and fielding restrictions.
- Implementing a graphical user interface (GUI) for better interactivity.
- Saving match states for resuming interrupted games.
Feel free to explore, fork, or contribute to this repository. Happy coding! π