---- 4-Digit Digital Door Lock Game ----
This project is a console-based mini-game developed as part of my final project for the first semester of Software Engineering. It combines programming concepts I learned during the course with techniques and knowledge I researched independently. The game challenges players to guess a randomly generated 4-digit code through logic and deduction.
Features:
Difficulty Levels: Easy (10 attempts) Normal (5 attempts) Hard (3 attempts) Input Validation: Ensures that players enter exactly 4 numeric digits. Detailed Feedback: Tells players which digits are correct and in the right position. Identifies correct digits but in the wrong position. Replay Option: Players can restart the game after completing a session.
Game Rules:
The game generates a random 4-digit code with unique digits (0-9). The player has a limited number of attempts (based on the selected difficulty) to guess the code. After each guess, the game provides feedback: Correct and in Position: The digit is correct and in the correct position. Correct but in Wrong Position: The digit is correct but not in the correct position. If the player guesses all 4 digits correctly, they unlock the digital lock and win. If the player exhausts all attempts, the game reveals the secret code.
This project allowed me to:
Apply Programming Fundamentals: Utilize arrays, loops, conditionals, and functions in C. Enhance Input Handling: Implement robust input validation to ensure a smooth user experience. Explore Randomization: Create unique, non-repeating random numbers for the secret code. Develop Problem-Solving Skills: Debug and resolve logical errors during the development process. Structure Code Efficiently: Write clean, maintainable code with modular functions.
This project is licensed under the CC0 License. Feel free to use, modify, and distribute the code.