- Cricket Score Display project is made in C language. Its UI is compatible with Windows 11 cmd.
It was developed inCodeBlock 20.03 IDE.
A console-based C application for managing live cricket match scores with colorful ANSI UI, team selection, toss simulation, real-time updates, and detailed statistics. Developed as a mini-project for Master of Computer Applications.
- Team Selection: Choose from 10 international teams (Afghanistan, Australia, Bangladesh, England, India, Nepal, New Zealand, Pakistan, South Africa, Sri Lanka) with validation to prevent duplicates
- Toss & Innings: Simulate toss, let winner choose batting/bowling first
- Live Score Updates:
- Runs, balls (max 120), wickets (max 10)
- Sixes/fours with score consistency validation
- Highest run scorer name
- Innings status (ongoing/completed)
- Statistics Display: View runs, full match stats, and final results (win by runs/wickets, tie, or ongoing)
- Interactive UI: ANSI color-coded menus, error highlights, bold text for Windows CMD compatibility
-
Compile (GCC/Code::Blocks):
gcc -o cricket_score cricket_score_display_code.c
-
Run:
./cricket_score # Linux/Mac cricket_score.exe # Windows
-
Follow prompts: Select teams โ Toss โ Update scores โ View stats/results
Requirements: GCC compiler, terminal with ANSI support (Windows 11 CMD tested)
Cricket_Score_Display/
โโโ cricket_score_display_code.c # Main source code (17.7k lines)
โโโ Project_report.pdf # Detailed documentation (74 pages)
โโโ README.md # You're reading it!
struct Team {
char team_name;
int score, ball, wicket, six, four, inning;
char player_scored_highest_run;
};| Function | Purpose |
|---|---|
selectteam() |
Team selection from list |
toss_check() |
Toss winner selection |
update_score_data() |
Score/ball/wicket/sixes/fours input + validation |
print_match_statistics() |
Detailed team stats |
show_match_result() |
Win/tie/ongoing result |
Validation Examples:
- Balls โค 120, wickets โค 10
- Score โฅ (6รsixes + 4รfours)
โ Test Cases Covered:
- Team selection conflict (same team twice)
- Invalid toss/choice inputs
- Balls > 120, wickets > 10
- Score inconsistency with sixes/fours
- Match results (win/tie/ongoing)
โ Error Handling:
- Color-coded error messages
- Input re-prompting
- Data integrity checks
- Basic C concepts: structures, arrays, pointers, functions, control flow
- Modular design with input validation
- Engaging console UI using ANSI escapes
- File I/O for match saving/loading
- GUI version (ncurses/Qt)
- Multi-format support (T20/ODI/Test)
- Network multiplayer score sharing
Chandradeep Kumar Raj
MCA
Greater Noida Institute of Technology
January 2025
MIT License - Feel free to use and modify!
โญ Star this repo if useful!
๐ Clone & compile: git clone <repo-url>
๐ Issues? Open a ticket!
