Olympic Insides is a C program designed to track and analyze medal counts for various countries in the Olympics. This project allows users to input medal data for multiple countries and provides analysis based on total medals, points, and rankings.
- Input medal data (gold, silver, bronze) for multiple countries
- Calculate total medals and points for each country
- Rank countries based on their performance
- Provide detailed analysis of medal distribution
- Display top performers in various categories
- Generate simple ASCII-based charts for visual representation
The project consists of the following files:
main.c
- Main program filelib/medal_analysis.h
- Header file for analysis functionslib/medal_analysis.c
- Implementation of analysis functions
-
Ensure you have a C compiler installed (e.g., GCC).
-
Open a terminal and navigate to the project directory.
-
Compile the program using the following command:
gcc main.c ./lib/medal_analysis.c -o OlympicInsights
Run the build:
./OlympicInsights
Or use the provided Makefile:
Use the following command to compile the program:
make
Run the build:
make run
Clear the build directory:
make clean
-
Run the compiled program:
./main
- When prompted, enter the country name and the number of gold, silver, and bronze medals for each country.
- Type 'y' to add another country or 'n' to finish entering data.
- The program will display a sorted medal table and provide an analysis of the results.
- Total medals awarded (gold, silver, bronze)
- Top performers in various categories:
- Most gold medals
- Most silver medals
- Most bronze medals
- Most total medals
- Highest points
- Medal distribution for the top 5 countries (using ASCII charts)
- Gold medal: 3 points
- Silver medal: 2 points
- Bronze medal: 1 point
- The program currently supports a maximum of 100 countries (defined by MAX_COUNTRIES).
- Country names are limited to 49 characters.
- Add more detailed statistical analysis
- Enhance visualization with more advanced charting libraries
I'm not accepting any contributions as this is my college assignment. However, if you have any suggestions or improvements, feel free to open an issue or submit a pull request. I'll be happy to review and discuss any changes. Also, you can fork the repository and make your own changes.
This project is licensed under the MIT License - see the LICENSE file for details.