From: Siraaj Khandkar Date: Wed, 25 Jul 2012 15:00:19 +0000 (-0400) Subject: Explicit sort function. X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=3803d7be41afd2665d4e29850bf6327173a19ddd;p=cellular-automata.git Explicit sort function. --- diff --git a/001/src/life_time.erl b/001/src/life_time.erl index 851aa05..1b639a7 100644 --- a/001/src/life_time.erl +++ b/001/src/life_time.erl @@ -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(