Note: one of the words in the example below had an improper response associated with it. The example is now correct.
The goal of this homework assignment is to create a word guessing game. The computer will know one word (provided by Player 2) and will accept guesses from Player 1 about what that word is. The game continues until Player 1 guesses the correct word. When Player 1 guesses the correct word, the computer should announce how many guesses it took Player 1 to figure it out.
This assignment must be completed individually. You can discuss high-level ideas with other students but you should not share code.
This assignment needs to be submitted on bSpace by 11:59pm on Friday, June 29th.
All of the homework assignments this semester are going to build on each other. We highly recommend that you spend some time thinking about your design and even going back to clean things up once you become more comfortable programming. You'll be glad you did once new assignments come out!
This is a game between two players -- Player 2 provides a word and Player 1 tries to guess what it is using feedback they receive from previous guesses.
Player 2 first enters the mystery word by entering a response to an "ask" block. The word is immediately hidden from view after Player 2 finishes entering it. The computer then starts by telling Player 1 how many letters are in the mystery word. Player 1 makes guesses, and the computer should tell the player whether their guess was right or wrong. If the player was wrong, the computer should also tell them how many letters in their guess were correctly positioned in the actual answer. The computer does not, however, have to say which letters were correct OR which positions they were in. The conversation alternates back and forth until Player 1 guesses the word correctly. Here is an example dialog (the text in the square brackets is simply to improve clarity and does not need to be printed):
[computer's word: fireball]
Computer starts by saying: "There are 8 letter(s) in my word. Try to guess it!"
Human guesses "factions"
Computer says "No, but 1 letter(s) is correct!" [the f]
Human guesses "facebook"
Computer says "No, but 3 letter(s) are correct!" [the f, the e and the b]
Human guesses "fireball"
Computer says "Yes, that is correct! You figured out my word in 2 guess(es)."
[...and the game ends]
Your game should have at least one sprite, but there are no graphical requirements other than that. Feel free to develop the graphics more if you'd like -- it may come in handy later!
You should start from a blank BYOB project.
* You can display the value of variables using the check box beside the variable name in the Variables tab.
* What block or blocks could you create to make your job easier here?
* Refer to the Number Guessing Game in Lab 3 for ideas if you get stuck.