1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-06 14:56:47 +02:00

change param order

This commit is contained in:
Justin Lin
2022-08-27 17:30:21 +08:00
parent 18281f72fc
commit 4bdd3ca089
3 changed files with 12 additions and 12 deletions

View File

@@ -91,17 +91,17 @@ function carve(dir, x, y, cells, rows, columns) =
/*dir 3*/ carve_bottom(x, y, cells, rows); /*dir 3*/ carve_bottom(x, y, cells, rows);
// go maze from (x, y) // go maze from (x, y)
function go_maze(x, y, cells, rows, columns, x_wrapping, y_wrapping, directions, seed) = function go_maze(x, y, cells, rows, columns, x_wrapping, y_wrapping, seed, directions) =
let( let(
r_dirs = directions(x, y, cells, seed), r_dirs = directions(x, y, cells, seed),
nxcells0 = set_visited(x, y, cells), nxcells0 = set_visited(x, y, cells),
nxcells1 = next_cells(x, y, r_dirs[0], nxcells0, rows, columns, x_wrapping, y_wrapping, directions, seed), nxcells1 = next_cells(x, y, r_dirs[0], nxcells0, rows, columns, x_wrapping, y_wrapping, seed, directions),
nxcells2 = next_cells(x, y, r_dirs[1], nxcells1, rows, columns, x_wrapping, y_wrapping, directions, seed), nxcells2 = next_cells(x, y, r_dirs[1], nxcells1, rows, columns, x_wrapping, y_wrapping, seed, directions),
nxcells3 = next_cells(x, y, r_dirs[2], nxcells2, rows, columns, x_wrapping, y_wrapping, directions, seed) nxcells3 = next_cells(x, y, r_dirs[2], nxcells2, rows, columns, x_wrapping, y_wrapping, seed, directions)
) )
next_cells(x, y, r_dirs[3], nxcells3, rows, columns, x_wrapping, y_wrapping, directions, seed); next_cells(x, y, r_dirs[3], nxcells3, rows, columns, x_wrapping, y_wrapping, seed, directions);
function next_cells(x, y, dir, cells, rows, columns, x_wrapping, y_wrapping, directions, seed) = function next_cells(x, y, dir, cells, rows, columns, x_wrapping, y_wrapping, seed, directions) =
let( let(
nx = next_x(x, dir, columns, x_wrapping), nx = next_x(x, dir, columns, x_wrapping),
ny = next_y(y, dir, rows, y_wrapping) ny = next_y(y, dir, rows, y_wrapping)
@@ -113,6 +113,6 @@ function next_cells(x, y, dir, cells, rows, columns, x_wrapping, y_wrapping, dir
carve(dir, x, y, cells, rows, columns), carve(dir, x, y, cells, rows, columns),
rows, columns, rows, columns,
x_wrapping, y_wrapping, x_wrapping, y_wrapping,
directions, seed,
seed directions
); );

View File

@@ -25,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,
directions, seed,
seed directions
); );

View File

@@ -25,8 +25,8 @@ 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,
directions, seed,
seed directions
) )
) )
[for(row = generated) each row]; [for(row = generated) each row];