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
/** | |
* fullscreenify() | |
* Stretch canvas to size of window. | |
* | |
* Zachary Johnson | |
* http://www.zachstronaut.com/ | |
* | |
* See also: https://gist.github.com/1178522 | |
*/ |
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 game-of-life | |
(:require [quil.core :as q] [quil.middleware :as m])) | |
;Core logic | |
(defn next-round | |
"Take as input a set of vectors representing coords of currently living cells | |
and return a set of vectors representing coords of living cells in the next stage" | |
[live-cells] | |
(letfn [(surrounding [[cell-x cell-y]] | |
(for [x [-1 0 1] |
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
(def ■ '■) | |
(def ▲ '▲) | |
(def ● '●) | |
(first [● ■ ▲]) ; ● | |
(second [● ■ ▲]) ; ■ | |
(nth [● ■ ▲] 2) ; ▲ | |
(rest [● ■ ▲]) ; (■ ▲) | |
(last [● ■ ▲]) ; ▲ | |
(butlast [● ■ ▲]) ; (● ■) |
These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.
- 🔴 Mandatory (for both beginners and intermediates)
- 🟩 For beginners
- 🟨 For intermediates