This is a simple interactive game written in C where the user can choose between two game modes:
- Guessing a random number.
- Guessing a secret word.
The program demonstrates core programming concepts such as:
- Modular code structure with separate files for headers, implementation, and the main program.
- Use of functions, conditionals, and loops.
- Basic use of random number generation. :P
- The program generates a random number between 1 and 100.
- The user must guess the number.
- The game ends when the user guesses the correct number.
- One player enters a secret word.
- Another player attempts to guess the word by entering guesses.
- The game ends when the correct word is guessed.
- Random number generation: Uses
rand()
for generating a random number. - String comparisons: Uses
strcmp
for word guessing logic.
Here are some ideas for improving the game:
- Add a scoring system based on the number of attempts.
- Implement a timer to measure how quickly the user guesses.
- Allow the user to define custom ranges for the random number.
- Add more game modes or levels of difficulty.