Created
April 6, 2015 12:58
-
-
Save goloroden/0a758e6612980c105dab to your computer and use it in GitHub Desktop.
"Rock, paper, scissors" in Lisp
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
(defun play (a b) | |
(cond ((equal a b) 'tie) | |
((or (and (equal a 'rock) (equal b 'scissors)) | |
(and (equal a 'scissors) (equal b 'paper)) | |
(and (equal a 'paper) (equal b 'rock))) '(first wins)) | |
(t '(second wins)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment