Skip to content

chandradeepkumarraj/c_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 

Repository files navigation

Cricket Score Display ๐Ÿ(Mini Project)

  • Cricket Score Display project is made in C language. Its UI is compatible with Windows 11 cmd.
    It was developed in CodeBlock 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.

โœจ Features

  • 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

๐Ÿ“ฑ Demo

Score Board

๐Ÿš€ Quick Start

  1. Compile (GCC/Code::Blocks):

    gcc -o cricket_score cricket_score_display_code.c
  2. Run:

    ./cricket_score    # Linux/Mac
    cricket_score.exe  # Windows
  3. Follow prompts: Select teams โ†’ Toss โ†’ Update scores โ†’ View stats/results

Requirements: GCC compiler, terminal with ANSI support (Windows 11 CMD tested)

๐Ÿ“ Project Structure

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!

โš™๏ธ Technical Details

Data Structure

struct Team {
    char team_name;
    int score, ball, wicket, six, four, inning;
    char player_scored_highest_run;
};

Key Functions

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)

๐Ÿงช Testing & Validation

โœ… 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

๐ŸŽฏ Objectives Achieved

  • Basic C concepts: structures, arrays, pointers, functions, control flow
  • Modular design with input validation
  • Engaging console UI using ANSI escapes

๐Ÿ”ฎ Future Enhancements

  • File I/O for match saving/loading
  • GUI version (ncurses/Qt)
  • Multi-format support (T20/ODI/Test)
  • Network multiplayer score sharing

๐Ÿ‘จโ€๐Ÿ’ป Author

Chandradeep Kumar Raj
MCA Greater Noida Institute of Technology
January 2025

๐Ÿ“„ License

MIT License - Feel free to use and modify!

โญ Star this repo if useful!
๐Ÿ“ Clone & compile: git clone <repo-url>
๐Ÿ› Issues? Open a ticket!

About

Cricket Score Display using C language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages