Better variable names.
[cellular-automata.git] / 003 / src / life.erl
index 562d1a0..74868da 100644 (file)
 -define(INTERVAL, 100).
 
 
--record(state, {x                 :: non_neg_integer()
-               ,y                 :: non_neg_integer()
-               ,n                 :: non_neg_integer()
-               ,bar               :: string()
-               ,board             :: array()
-               ,gen_count         :: non_neg_integer()
-               ,gen_duration      :: non_neg_integer()
-               ,print_time        :: non_neg_integer()
+-record(state, {x            :: non_neg_integer()
+               ,y            :: non_neg_integer()
+               ,n            :: pos_integer()
+               ,bar          :: nonempty_string()
+               ,board        :: array()
+               ,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
     ).
 
 
This page took 0.036133 seconds and 4 git commands to generate.