Memory Game

Link for the code:  MemoryGame

The game challenges players to memorize and input sequences of symbols (wasd) to earn points. The code includes several key components to manage the game logic, score tracking, and user interaction.

The game starts with a welcome message and instructions, guiding players on how to play. The main function opens or creates a file to store high scores, reads and prints the current scores, and then initiates the game. Players are presented with a sequence of symbols to memorize, and their score increases with each correct input. If they input an incorrect sequence, the game ends, and their final score is recorded.

The code also includes utility functions to clear the console and wait for user input, as well as functions to read and update the scores from a file. The scores are stored in a struct and sorted in descending order before being written back to the file. This ensures that the high scores are always up-to-date and displayed correctly.

Leave a Reply

Your email address will not be published. Required fields are marked *

@ 2024 Mark Pyatak