land-of-lisp-first-program

 

 1 (defparameter *small* 1)
 2 (defparameter *big* 100)
 3 
 4 (defun guess-my-number ()
 5   (ash (+ *small* *big*) -1))
 6 
 7 (defun smaller ()
 8   (setf *big* (1- (guess-my-number)))
 9   (guess-my-number))
10 
11 (defun bigger ()
12   (setf *small* (1+ (guess-my-number)))
13   (guess-my-number))
14 
15 (defun start-over()
16   (defparameter *small* 1)
17   (defparameter *big* 100)
18   (guess-my-number))
本站公眾號
   歡迎關注本站公眾號,獲取更多信息