Our guess-my-number game has the computer respond to the player’s request to start the game, and then to requests for either smaller or bigger guesses. For these, we need to define three global functions:
bigger. We’ll also define a function to start over with a different number, called
start-over. In Common Lisp, functions are defined with
defun, like this:
First, we specify the name and arguments for the function. Then we follow it up with the code that composes the function’s logic.
The first function we’ll define is
guess-my-number. This function uses the values of the
*small* variables to generate ...