Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
(defn sin-vals [offset]
(map #(Math/sin %) (iterate (partial + 0.1) offset)))
(let [events (chan)]
;; produce seqs of sine values
(go-loop [n 0]
(<! (timeout 200))
(>! events (sin-vals n))
(recur (inc n)))
(dotimes [_ 10]
;; Draw on screen
(map (fn [x y] {:x x :y y})
(range 3)
(take 3 (<!! events))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.