Skip to content

BishaFatimaa/CrackTheCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Crack the Code

Crack the Code is a simplified version of the classic code-breaking game, where you have to guess a secret passcode generated by the computer. You can also see the computer's attempts to crack your code. This C++ program offers an entertaining challenge for those who enjoy puzzles and code-breaking games.

How to Play

  1. The computer randomly generates its secret passcode. The passcode consists of three digits, each ranging from 1 to 5.

  2. You are asked to input your secret passcode by choosing three digits.

  3. The game begins, and both you and the computer make attempts to guess each other's passcode.

  4. You make the first move. You guess the computer's passcode by entering three digits.

  5. After your guess, the game reveals how many digits you guessed correctly, in the correct position, or not in the passcode at all.

  6. The computer then makes a guess at your passcode, and its result is displayed.

  7. This process continues until one of you successfully guesses the other's passcode.

  8. The game then displays the number of rounds it took for one of the players to win.

Playing Again

After a game is completed, you have the option to play again by typing 'Y' for yes or 'N' for no.

Running the Game

To run Crack the Code, follow these steps:

  1. Make sure you have a C++ compiler installed on your system.

  2. Copy the code provided and save it with a .cpp extension, such as crackthecode.cpp.

  3. Open your terminal or command prompt and navigate to the directory where you saved the file.

  4. Compile the code by entering the following command:

    g++ crackthecode.cpp -o crackthecode
  5. Run the game using this command:

    ./crackthecode
  6. Follow the on-screen instructions to play the game.

Have fun playing Crack the Code! Try to outsmart the computer and challenge your code-breaking skills. This game a console based game and can be turned into a more interactive and user friendly game by implementing GUI

About

A brain-teasing puzzle game where you decipher a secret combination through logic and deduction. Test your problem-solving skills and unveil the hidden code. It's a thrilling challenge for those who love cracking puzzles!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages