This is a C-based simulator that models a complete IPL-style cricket tournament. It schedules matches, simulates scores, calculates team standings, and optionally simulates playoffs. It includes weather-based rescheduling and allows queries for team-wise and venue-wise schedules.
main.c
– The core logic for initialization, scheduling, simulation, and output.playoffs.h
– Header file containing structures and logic for playoff simulation (must be present in the same directory).
To compile the program, use a C compiler like gcc
:
gcc main.c -o ipl_sim
Run the compiled binary:
./ipl_sim
- Initializes 8 IPL teams and their cities.
- Generates a full round-robin schedule (56 matches).
- Randomly simulates weather issues and reschedules if needed.
- Displays the full match schedule and writes it to
schedule.txt
. - Offers a menu:
- Option 1: Display matches for a specific team.
- Option 2: Display matches at a specific venue.
- Option 3: Exit menu and continue.
- Simulates all matches with random scores.
- Displays the final points table and asks if playoffs should be simulated.
- Console: Displays match schedules, team/venue-specific schedules, and final points table.
- File:
schedule.txt
contains the entire match schedule.
- Standard C Libraries:
stdio.h
stdlib.h
string.h
time.h
- Note: Ensure
playoffs.h
is implemented and included properly for playoff simulation to work.
Developed by: ZETTABYTES