X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=003%2Fsrc%2Flife.erl;h=74868da09e63fe754a3bb5938080eead4d11e432;hb=1332e0c3c23643c3eeac5e3d7a64dcac4591e488;hp=f8b6bcc6086e5380fe87c9d16f660222744b412a;hpb=39738e2236f416f7bfaada7f41c8838af807e697;p=cellular-automata.git diff --git a/003/src/life.erl b/003/src/life.erl index f8b6bcc..74868da 100644 --- a/003/src/life.erl +++ b/003/src/life.erl @@ -12,10 +12,10 @@ -record(state, {x :: non_neg_integer() ,y :: non_neg_integer() - ,n :: non_neg_integer() - ,bar :: string() + ,n :: pos_integer() + ,bar :: nonempty_string() ,board :: array() - ,gen_count :: non_neg_integer() + ,gen_count :: pos_integer() ,gen_duration :: non_neg_integer() ,print_time :: non_neg_integer() }). @@ -89,7 +89,7 @@ do_print_status(Bar, X, Y, N, GenCount, TimeMic, PrintTimeMic) -> do_print_board(Board) -> - CharLists = array:to_list( + RowStrings = array:to_list( array:map( fun(_, Row) -> array:to_list( @@ -106,10 +106,10 @@ do_print_board(Board) -> ), ok = lists:foreach( - fun(CharList) -> - ok = io:format("~s~n", [CharList]) + fun(RowString) -> + ok = io:format("~s~n", [RowString]) end, - CharLists + RowStrings ).