Skip to content

Instantly share code, notes, and snippets.

@goloroden
Created April 6, 2015 12:58
Show Gist options
  • Save goloroden/0a758e6612980c105dab to your computer and use it in GitHub Desktop.
Save goloroden/0a758e6612980c105dab to your computer and use it in GitHub Desktop.
"Rock, paper, scissors" in Lisp
(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