1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-16 21:58:26 +01:00

add directions param

This commit is contained in:
Justin Lin 2022-08-27 17:31:36 +08:00
parent 4bdd3ca089
commit ce257f859b

View File

@ -11,11 +11,10 @@
use <_impl/_mz_square_cells_impl.scad> use <_impl/_mz_square_cells_impl.scad>
use <mz_square_initialize.scad> 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, directions) =
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,
@ -26,5 +25,5 @@ function mz_square(rows, columns, start = [0, 0], init_cells, x_wrapping = false
x_wrapping, x_wrapping,
y_wrapping, y_wrapping,
seed, seed,
directions is_undef(directions) ? function(x, y, cells, seed) rand_dirs(x, y, cells, seed) : directions
); );