Previous guesses is updated with the value of attempt

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: correct-answer will be set to puzzle • current-guess will be set to match puzzle, except where there is an upper case letter, it will be replaced by a dash (“-”) • previous-guesses will be set to the empty string • guesses-left will be set to the number that matches the level 4 CS 116 Fall 2012 Assignment 04 Due at 4:00 pm Monday, October 15th 4. Write a function called make-guess that consumes a non ­empty string (attempt) and produces a string. The following chart explains how the state variables will change and the value that should be produced for different values of attempt. Value of attempt A string that is a single character that is not an upper case letter. A string that is a single upper case letter that has already been guessed. A string that is a single upper case letter that has not been previously guessed, and is not in the puzzle. Changes to state variables None String produced None...
View Full Document

Ask a homework question - tutors are online