Last active
August 29, 2015 14:02
-
-
Save kongscn/7916e1ecb99ad89a4f2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Common Lisp code example | |
(defun foo (n) | |
(lambda (i) (incf n i))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Guess number | |
(defparameter *small* 1) | |
(defparameter *big* 100) | |
(defun guess-my-number () | |
(ash (+ *small* *big*) -1)) | |
(defun smaller () | |
(setf *big* (1- (guess-my-number))) | |
(guess-my-number)) | |
(defun bigger () | |
(setf *small* (1+ (guess-my-number))) | |
(guess-my-number)) | |
(defun start-over () | |
(defparameter *small* 1) | |
(defparameter *big* 100) | |
(guess-my-number)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment