{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

The function will update the state variables as

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: s, spaces, and letters that have been correctly guessed during the course of the game • previous-guesses – a string that contains the letters that have already been guessed by the player. The most recent guess is at index position 0 of the string. • guesses-left – a natural number representing the number of incorrect guesses the player has left before losing the game 3. Write a function called reset-game that consumes a string (puzzle) and a symbol (level) and produces (void). The puzzle is the full text of the secret phrase, including letters and spaces. All the letters are upper case. The level is one of ‘Beginner, ‘Intermediate or ‘Advanced. The ‘Beginner level is allowed 10 incorrect guesses, the ‘Intermediate level is allowed 6 incorrect guesses, and the ‘Advanced level is allowed 3 incorrect guesses. The function will update the state variables as follows: ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online