At this week's Clojure Developers Barcelona meetup, we did the Cellular Automata kata in Clojure.
We did mob programming and used a mix of TDD and RDD.
This is the code we wrote:
First, the tests using Midje for the rules 30 and 90:
and the tests for the evolution and rendering of automata:
This is the corresponding code for the rules:
and for the automaton evolution and rendering:
Printing on the REPL the result of rendering the Rule 90 automaton evolution during 15 steps, we obtain a nice Sierpinski triangle
:
You can find the code in this GitHub repository.
As usual, it was a pleasure to meet and program with Clojure Developers Barcelona members.
No comments:
Post a Comment