Skip to content

aishadabbagh/warmup-w07-d03-ruby-hack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Fallout Hacking Game

The popular video games Fallout 3 and Fallout: New Vegas have a computer "Hacking" minigame where the player must correctly guess the correct password from a list of same-length words. Your challenge is to implement this game yourself.

The game operates similarly to the classic board game Mastermind. The player has only 4 guesses and on each incorrect guess the computer will indicate how many letter positions are correct.

For example, if the password is MIND and the player guesses MEND, the game will indicate that 3 out of 4 positions are correct (M_ND). If the password is COMPUTE and the player guesses PLAYFUL, the game will report 0/7. While some of the letters match, they're in the wrong position.

Present the player with 10 words of the same length. The length can be 4 to 15 letters. The player then has 4 guesses, and on each incorrect guess indicate the number of correct positions.

Your program should completely ignore case sensitivity when making the position checks.

Here's an example game:

#Output:
SCORPION
FLOGGING
CROPPERS
MIGRAINE
FOOTNOTE
REFINERY
DIZZYING
VAULTING
CONTINUE
PROTECTS
DESCENTS
QUIZZING
"Guess (4 left)? "
migraine
"0/8 correct"
"Guess (3 left)?"
protects
"3/8 correct"
"Guess (2 left)?" 
croppers
"8/8 correct"
"Welcome"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Ruby 100.0%