Fix: sending the current, not next, state back to time.
[cellular-automata.git] / 001 / life.erl
index 9c84bd8..31113cb 100644 (file)
@@ -121,7 +121,7 @@ cell(MyID, MyParent, MyNeighbors, MyState) ->
 cell(MyID, MyParent, MyNeighbors, MyState, {[], States}) ->
     LiveNeighbors = lists:sum(States),
     MyNewState = new_state(MyState, LiveNeighbors),
-    MyParent ! {tock, {MyID, MyNewState}},
+    MyParent ! {tock, {MyID, MyState}},
     cell(MyID, MyParent, MyNeighbors, MyNewState);
 
 % Awaiting requests and replies
This page took 0.026704 seconds and 4 git commands to generate.