Skip to content

Instantly share code, notes, and snippets.

Matthew O. Smith m0smith

Block or report user

Report or block m0smith

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View rps.clj
;; An implementation of the rock-paper-scissors variant -
;; rock-paper-scissors-lizard-spock - based on Alex Miller's core.async
;; implementation.
;; -
;; -
;; -
;; -
(require 'clojure.core.async :refer :all)
puredanger / rps.clj
Created Jul 10, 2013
Rock Paper Scissors with core.async
View rps.clj
(require 'clojure.core.async :refer :all)
(def MOVES [:rock :paper :scissors])
(def BEATS {:rock :scissors, :paper :rock, :scissors :paper})
(defn rand-player
"Create a named player and return a channel to report moves."
(let [out (chan)]
(go (while true (>! out [name (rand-nth MOVES)])))
anonymous / pipe.clj
Created Dec 18, 2012
View pipe.clj
(defn pipe
"Returns a vector containing a sequence that will read from the
queue, and a function that inserts items into the queue.
(let [q (LinkedBlockingQueue.)
EOQ (Object.)
NIL (Object.)
s (fn queue-seq []
You can’t perform that action at this time.