Skip to content

Instantly share code, notes, and snippets.

@cgrand
Created November 8, 2012 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgrand/4038643 to your computer and use it in GitHub Desktop.
Save cgrand/4038643 to your computer and use it in GitHub Desktop.
(ns life.core
(:require [quil.core :as q]))
;; ajouter [quil "1.6.0"] à project.clj
(defn setup []
(q/smooth)
(q/frame-rate 20))
(defn draw []
(q/background 200)
(q/stroke 150)
(q/stroke-weight 1)
(q/fill 255)
(doseq [[i j] @world]
(q/rect (* 30 i) (* 30 j) 28 28)))
(q/defsketch example
:title "Life!"
:setup setup
:draw draw
:size [600 600])
#_(future
(while true
(Thread/sleep 200)
(swap! world step)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment