home
/
code
/
cellular-automata.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Explicit sort function.
[cellular-automata.git]
/
001
/
src
/
life_time.erl
diff --git
a/001/src/life_time.erl
b/001/src/life_time.erl
index
851aa05
..
1b639a7
100644
(file)
--- 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,
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(
StateChars = [state_to_char(S) || {_, S} <- SortedStatePairs],
ok = io:format(
This page took
0.026048 seconds
and
4
git commands to generate.