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 problems.life | |
(:require [clojure.string]));;should use "only" here! (use '[clojure.data.json :only (read-json json-str)]) | |
;This function determines wether a cell is alive or dead. | |
;Its a simplified version of the classic life function. | |
; f: the initial board function (f), | |
; x, y (the x/y coordinates) | |
(defn live [f x y] | |
(let [neighbors | |
(+ |