Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

perl- a game of rock-paper-scissors

Name: Anonymous 2009-10-18 1:30

i am teaching myself perl. i want to have two scrips play r-p-s and a third to keep score. for now it will be on a single computer. then over a network. im using linux.

Name: Anonymous 2009-10-18 7:57

(defun r-p-s ()            
  (elt '(r p s) (random 3)))
(defun win (x y)             
  (subsetp (member x '(r p s))
           (member y '(r p s))))
(defun run (&optional (times 0))
  (loop until (zerop (decf times))
       collect (win (r-p-s) (r-p-s))))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List