Created
November 8, 2012 12:56
-
-
Save cgrand/4038643 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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