home
/
code
/
cellular-automata.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set interval back to 0.1 sec.
[cellular-automata.git]
/
001
/
src
/
life_time.erl
diff --git
a/001/src/life_time.erl
b/001/src/life_time.erl
index
851aa05
..
6827d29
100644
(file)
--- a/
001/src/life_time.erl
+++ b/
001/src/life_time.erl
@@
-17,7
+17,7
@@
]).
]).
--define(INTERVAL, 0). % In milliseconds
+-define(INTERVAL,
10
0). % In milliseconds
-define(CHAR_DEAD, 32). % Space
-define(CHAR_ALIVE, 111). % o
-define(CHAR_DEAD, 32). % Space
-define(CHAR_ALIVE, 111). % o
@@
-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.029927 seconds
and
4
git commands to generate.