Removed unnecessary call to length().
[cellular-automata.git] / 005 / life.awk
index 3c9c7d7..101f66a 100755 (executable)
@@ -59,7 +59,7 @@ function get_new_state(state, live_neighbors) {
 
 
 function set_generation(board, gen_id, y, x) {
-    split("N,NE,E,SE,S,SW,W,NW", directions, ",");
+    num_directions = split("N,NE,E,SE,S,SW,W,NW", directions, ",");
 
     offsets["N" , "x"] =  0;
     offsets["N" , "y"] = -1;
@@ -95,8 +95,6 @@ function set_generation(board, gen_id, y, x) {
                 state = board[prev_gen_id, yi, xi];
                 live_neighbors = 0;
 
-                num_directions = length(directions);
-
                 for (dir_i=1; dir_i <= num_directions; dir_i ++) {
                     direction = directions[dir_i];
 
This page took 0.021435 seconds and 4 git commands to generate.