NayJ

October 10th, 2010, 03:02 AM

I was wondering if anyone knew how to use the 'guess.ss' teachpack found in DrRacket/Scheme? I ask because in my CS class, we're given word problems, that ask us to create a function, and sometimes an answer to run in scheme. Having said that this is my problem:

Develop the function check-guess. It consumes two numbers, guess and target. Depending on how guess relates to target, the function produces one of the following three answers: 'TooSmall, 'Perfect, or 'TooLarge.

The function implements one part of a two-player number guessing game. One player picks a random number between 0 and 99999. The other player's goal is to determine this number, called target, with the least number of guesses. To each guess, the first player responds with one of the three responses that check-guess implements.

The function 'check-guess' and the teachpack guess.ss implement the first player. The teachpack picks the random number, pops up a window in which the second player can choose digits, and hands over the guess and the target to check-guess. To play the game, set the teachpack to guess.ss using the Language|Set teachpack option. Then evaluate the expression

(guess-with-guicheck-guess)

after check-guess has been thoroughly tested.

Develop the function check-guess. It consumes two numbers, guess and target. Depending on how guess relates to target, the function produces one of the following three answers: 'TooSmall, 'Perfect, or 'TooLarge.

The function implements one part of a two-player number guessing game. One player picks a random number between 0 and 99999. The other player's goal is to determine this number, called target, with the least number of guesses. To each guess, the first player responds with one of the three responses that check-guess implements.

The function 'check-guess' and the teachpack guess.ss implement the first player. The teachpack picks the random number, pops up a window in which the second player can choose digits, and hands over the guess and the target to check-guess. To play the game, set the teachpack to guess.ss using the Language|Set teachpack option. Then evaluate the expression

(guess-with-guicheck-guess)

after check-guess has been thoroughly tested.