Overview - SchoolRack

advertisement
BYOB Project #3 – Hangman
Overview
You don’t need a computer to play Hangman, but it’s a lot of fun if you do. The game will pit a player
(you) against the computer, which will be randomly choosing Hangman words from a dictionary.
Specifications and grading
Detailed requirements
Variables
 You will display the Hangman word, the guessed letters, number of remaining guesses, and how
many wins and losses you have
 Number of remaining guesses will start with 6
 Number of wins will start at 0, and number of losses will start at 0
 You need to create your own Dictionary. You will enter at least 20 words in your Dictionary.
 You need to create a list to represent the Hangman word as a list
Narrator Sprite
 Asks the user for letter guesses
 The IsLetterInWord predicate block detects if the letter is in the Hangman word.
o IsLetterInWord must have two parameters: (1) letter, (2) word
o It returns/reports TRUE if the letter is contained in the word
 If the letter is in the Hangman word, the sprite tells the player they found a letter and the
Hangman word is updated on the screen. This must be implemented with the PlaceLetter
command block.
o PlaceLetter must have three parameters: (1) letter, (2) word, (3)guessedWordAsList


If the letter is not in the Hangman word, the sprite tells the player they missed and the number
of guesses remaining is decremented by 1. This must be implemented with the MissedLetter
command block.
o MissedLetter does not take any parameters
If the player enters a duplicate letter, the sprite tells the user that letter was already guessed
When you win
 You will increment your Win score by 1
 The Narrator Sprite will display a message of success for 5 seconds
 You will show a “Play Again” sprite, which when clicked will start a new game and keep the
running score
When you lose
 You will increment your Loss score by 1
 Narrator Sprite will display a message of failure for 5 seconds
 You will show a “Play Again” sprite, which when clicked will start a new game and keep the
running score
Additional extensions
Once you complete the above, you can extend your program. Some suggestions:


Create a Hangman sprite that adds the head/body/arms/legs for each wrong guess
Support multiple words or a phrase
Grading criteria
The detailed list for what we will use to grade your projects is below. Please review your projects before
submitting to be sure you meet all of them. If you have any questions on whether you meet a
requirement, please ask us!!
Requirement
Variables are initialized as specified above
The Hangman Word is initially shown with the right
number of blanks/stars
Guessed letters are displayed
The Narrator Sprite asks for a guess
The Narrator Sprite tells the player they have guessed
correctly or incorrectly as appropriate. The
IsLetterInWord predicate block must be used.
If the player enters a duplicate, the sprite tells the user
the letter has already been guessed. Try again
Learning Targets/Standards
Create, store data in, and consume
data from variables.
Create, populate, and consume data
from lists.
Create, populate, and consume data
from lists
Create and Call custom functions that
use arguments to influence output
Design and implement an algorithm for
searching for data in a list
If the player guesses the right letter, the Hangman Word
shows it properly in all appropriate spaces. This must be
implemented with the PlaceLetter command block
The number of remaining guesses is decremented only if
the player guesses a wrong letter. This must be
implemented with the MissedLetter command block
A message of success or failure is displayed by the
Narrator Sprite for 5 seconds at the end of game. If the
player loses, the Sprite should SAY the word
The Wins/Losses counter is incremented/decremented by
1 appropriately at the end of a game
A “Play Again” sprite is shown at the end of the game that
starts a new Hangman game, but keeps the score intact
Good programming: Program has start and stop. Program
is repeatable and initializes state correctly
Create and Call custom functions that
use arguments to influence output
Design and implement an algorithm for
searching for data in a list
Create and Call custom functions that
use arguments to influence output
Design and implement an algorithm for
searching for data in a list
Create and Call custom functions that
use arguments to influence output
Create and Call custom functions that
use arguments to influence output
Create and Call custom functions that
use arguments to influence output
Create and Call custom functions that
use arguments to influence output
Create and Call custom functions that
use arguments to influence output
Design and implement an algorithm for
searching for data in a list
Create, store data in, and consume
data from lists.
Good programming: Use of comments in your code
Game Polish and Game Play
I can create comments in SNAP
Create and Call custom functions that
use arguments to influence output
Design and implement an algorithm for
searching for data in a list
Create, store data in, and consume
data from lists.
Extra Credit: Create a Hangman sprite
Extra Credit: Support a phrase or multiple words
Animate a sprite in response to
keyboard input
Create and Call custom functions that
use arguments to influence output
Design and implement an algorithm for
searching for data in a list
Create, store data in, and consume
data from lists.
Extra Credit: Create Your Own Extension
Create and Call custom functions that
use arguments to influence output
Design and implement an algorithm for
searching for data in a list
Create, store data in, and consume
data from lists.
Total points
100
Download