From 95dc133d0d808225463f9f5543b57718d09d55aa Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Wed, 6 Oct 2021 16:29:33 +0800 Subject: [PATCH] refactor --- src/maze/mz_hex_walls.scad | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/maze/mz_hex_walls.scad b/src/maze/mz_hex_walls.scad index a810c76b..d861e6d9 100644 --- a/src/maze/mz_hex_walls.scad +++ b/src/maze/mz_hex_walls.scad @@ -40,9 +40,11 @@ function mz_hex_walls(cells, rows, columns, cell_radius, left_border = true, bot cell_p = _cell_position(cell_radius, x, 0), walls1 = _bottom(cell_radius), walls2 = [ - for(pair = (x % 2 == 0 ? [_bottom_left(cell_radius), _bottom_right(cell_radius)] : [])) - for(wall = pair) - wall + for( + pair = (x % 2 == 0 ? [_bottom_left(cell_radius), _bottom_right(cell_radius)] : []), + wall = pair + ) + wall ] ) walls2 == [] ? @@ -55,9 +57,8 @@ function mz_hex_walls(cells, rows, columns, cell_radius, left_border = true, bot ] ] : [], bottom_border_walls = [ - for(pair = bottom_pair_walls) - for(wall = pair) - wall + for(pair = bottom_pair_walls, wall = pair) + wall ] ) concat(walls, left_border_walls, bottom_border_walls); \ No newline at end of file