mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-01-17 14:18:13 +01:00
refactor
This commit is contained in:
parent
18d3757079
commit
18281f72fc
@ -14,7 +14,8 @@ use <mz_square_initialize.scad>
|
|||||||
function mz_square(rows, columns, start = [0, 0], init_cells, x_wrapping = false, y_wrapping = false, seed) =
|
function mz_square(rows, columns, start = [0, 0], init_cells, x_wrapping = false, y_wrapping = false, seed) =
|
||||||
let(
|
let(
|
||||||
init_undef = is_undef(init_cells),
|
init_undef = is_undef(init_cells),
|
||||||
mz = init_undef ? mz_square_initialize(rows, columns) : init_cells
|
mz = init_undef ? mz_square_initialize(rows, columns) : init_cells,
|
||||||
|
directions = function(x, y, cells, seed) rand_dirs(x, y, cells, seed)
|
||||||
)
|
)
|
||||||
go_maze(
|
go_maze(
|
||||||
start.x,
|
start.x,
|
||||||
@ -24,6 +25,6 @@ function mz_square(rows, columns, start = [0, 0], init_cells, x_wrapping = false
|
|||||||
len(mz[0]),
|
len(mz[0]),
|
||||||
x_wrapping,
|
x_wrapping,
|
||||||
y_wrapping,
|
y_wrapping,
|
||||||
function(x, y, cells, seed) rand_dirs(x, y, cells, seed),
|
directions,
|
||||||
seed
|
seed
|
||||||
);
|
);
|
||||||
|
@ -17,6 +17,7 @@ function mz_square_cells(rows, columns, start = [0, 0], init_cells, x_wrapping =
|
|||||||
mz = init_undef ? mz_square_initialize(rows, columns) : init_cells,
|
mz = init_undef ? mz_square_initialize(rows, columns) : init_cells,
|
||||||
r = len(mz),
|
r = len(mz),
|
||||||
c = len(mz[0]),
|
c = len(mz[0]),
|
||||||
|
directions = function(x, y, cells, seed) rand_dirs(x, y, cells, seed),
|
||||||
generated = go_maze(
|
generated = go_maze(
|
||||||
start.x,
|
start.x,
|
||||||
start.y,
|
start.y,
|
||||||
@ -24,7 +25,7 @@ function mz_square_cells(rows, columns, start = [0, 0], init_cells, x_wrapping =
|
|||||||
r, c,
|
r, c,
|
||||||
x_wrapping,
|
x_wrapping,
|
||||||
y_wrapping,
|
y_wrapping,
|
||||||
function(x, y, cells, seed) rand_dirs(x, y, cells, seed),
|
directions,
|
||||||
seed
|
seed
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user