Explicit sort function.
[cellular-automata.git] / 001 / src / life_time.erl
index 851aa05..1b639a7 100644 (file)
@@ -99,7 +99,10 @@ handle_cast({tock, {ID, CellState}},
     case NewRepliesPending of
         0 ->
             NewGenCount = GenCount + 1,
-            SortedStatePairs = lists:sort(NewStatePairs),
+            SortedStatePairs = lists:sort(
+                fun({A, _}, {B, _}) -> A < B end,
+                NewStatePairs
+            ),
             StateChars = [state_to_char(S) || {_, S} <- SortedStatePairs],
 
             ok = io:format(
This page took 0.018927 seconds and 4 git commands to generate.