From 8f1d6a6e1a1210e31fdc5002c556793f84b87e0f Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Wed, 6 Oct 2021 16:33:17 +0800 Subject: [PATCH] refactor --- src/maze/_impl/_mz_square_initialize.scad | 29 +++++++++++------------ src/maze/_impl/_mz_theta_cells.scad | 3 +-- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/maze/_impl/_mz_square_initialize.scad b/src/maze/_impl/_mz_square_initialize.scad index d0ec8e97..e86ff68c 100644 --- a/src/maze/_impl/_mz_square_initialize.scad +++ b/src/maze/_impl/_mz_square_initialize.scad @@ -19,19 +19,18 @@ function _mz_mask(mask) = columns = len(mask[0]) ) [ - for(y = [0:rows - 1]) - for(x = [0:columns - 1]) - mask[rows - y - 1][x] == 0 ? - cell( - x, y, - 4, // mask - true // visited - ) - : - cell( - x, y, - // all cells have top and right walls - 3, // unvisited - false - ) + for(y = [0:rows - 1], x = [0:columns - 1]) + mask[rows - y - 1][x] == 0 ? + cell( + x, y, + 4, // mask + true // visited + ) + : + cell( + x, y, + // all cells have top and right walls + 3, // unvisited + false + ) ]; \ No newline at end of file diff --git a/src/maze/_impl/_mz_theta_cells.scad b/src/maze/_impl/_mz_theta_cells.scad index b5429508..f06b91ca 100644 --- a/src/maze/_impl/_mz_theta_cells.scad +++ b/src/maze/_impl/_mz_theta_cells.scad @@ -104,8 +104,7 @@ function config_nbrs(maze) = ] ], cell_outwards_lt = [ - for(row = mz_empty_outs) - for(c = row) + for(row = mz_empty_outs, c = row) let( ri = get_ri(c), ci = get_ci(c),