home
/
code
/
cellular-automata.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
172421c
)
Printing cell count in status bar.
author
Siraaj Khandkar
<siraaj@khandkar.net>
Mon, 23 Jul 2012 15:10:41 +0000
(11:10 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Mon, 23 Jul 2012 15:10:41 +0000
(11:10 -0400)
001/src/time.erl
patch
|
blob
|
blame
|
history
diff --git
a/001/src/time.erl
b/001/src/time.erl
index
d933215
..
02cd61e
100644
(file)
--- a/
001/src/time.erl
+++ b/
001/src/time.erl
@@
-89,6
+89,7
@@
handle_cast({tock, {ID, CellState}},
,state_pairs=StatePairs
,replies_pending=RepliesPending
,gen_count=GenCount
,state_pairs=StatePairs
,replies_pending=RepliesPending
,gen_count=GenCount
+ ,num_cells=NumCells
}=State) ->
NewStatePairs = [{ID, CellState} | StatePairs],
}=State) ->
NewStatePairs = [{ID, CellState} | StatePairs],
@@
-101,7
+102,10
@@
handle_cast({tock, {ID, CellState}},
SortedStatePairs = lists:sort(NewStatePairs),
StateChars = [state_to_char(S) || {_, S} <- SortedStatePairs],
ok = do_print_bar(X),
SortedStatePairs = lists:sort(NewStatePairs),
StateChars = [state_to_char(S) || {_, S} <- SortedStatePairs],
ok = do_print_bar(X),
- ok = io:format("GENERATIONS: ~b~n", [NewGenCount]),
+ ok = io:format(
+ "CELLS: ~b GENERATIONS: ~b~n",
+ [NumCells, NewGenCount]
+ ),
ok = do_print_bar(X),
ok = do_print_state_chars(X, StateChars),
ok = do_print_bar(X),
ok = do_print_bar(X),
ok = do_print_state_chars(X, StateChars),
ok = do_print_bar(X),
This page took
0.034086 seconds
and
4
git commands to generate.