Skip to content
Browse files

The first program from the book.

  • Loading branch information...
0 parents commit 77926b6a4701fcc5c12218537162a9e4346e71cc @JEG2 committed Jan 15, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 chapter_2/guess.el
18 chapter_2/guess.el
@@ -0,0 +1,18 @@
+(defvar small 1)
+(defvar big 100)
+
+(defun guess-my-number ()
+ (ash (+ small big) -1))
+
+(defun smaller ()
+ (setq big (1- (guess-my-number)))
+ (guess-my-number))
+
+(defun bigger ()
+ (setq small (1+ (guess-my-number)))
+ (guess-my-number))
+
+(defun start-over ()
+ (setq small 1)
+ (setq big 100)
+ (guess-my-number))

0 comments on commit 77926b6

Please sign in to comment.
Something went wrong with that request. Please try again.