Jipstyle wrote:

I'm pretty sure the assignment was due over a month ago.

In that case...

**Code:**

CL-USER>

(defun number-game (num-guesses)

(let ((num (+ (random 90) 10)))

(dotimes (i num-guesses)

(format t "~%You have ~a chances left to guess the number.~%" (- num-guesses i))

(format t "Guess? ")

(setq guess (read))

(cond ((< guess num)

(format t "You guessed too low!~%"))

((> guess num)

(format t "You guessed too high!~%"))

(t

(format t "You guessed correctly!~%")

(return t))))))

NUMBER-GAME

CL-USER> (number-game 7)

You have 7 chances left to guess the number.

Guess? 50

You guessed too low!

You have 6 chances left to guess the number.

Guess? 75

You guessed too high!

You have 5 chances left to guess the number.

Guess? 67

You guessed too low!

You have 4 chances left to guess the number.

Guess? 71

You guessed too low!

You have 3 chances left to guess the number.

Guess? 73

You guessed too low!

You have 2 chances left to guess the number.

Guess? 74

You guessed correctly!

T

CL-USER>