Jump to content

Maze generation: Difference between revisions

(→‎{{header|Julia}}: updated to julia v0.6)
Line 301:
data d;
integer i, j;
 
b_suffix call_n(N, b_suffix, d, "+---");
j = N;
whileb_suffix(d, (j"+\n") {;
 
b_suffix(d, "+---");
b_suffix call_n(N, b_suffix, d, "| * ");
j -= 1;
b_suffix(d, "|\n");
}
 
{
b_extend call_n(N, b_extend, b, d);
b_suffix(d, "+\n");
 
}
j = N;
while (j) {
b_suffix(d, "| * ");
j -= 1;
}
{
b_suffix(d, "|\n");
}
i = N;
while (i) {
b_extend(b, d);
i -= 1;
}
b_size(d, N * 4 + 2);
 
{b_extend(b, d);
b_extend(b, d);
}
}
 
Line 356 ⟶ 337:
if (b[q + p] == '*') {
walk_cell(b, N, line_size, p, q, x_offsets, y_offsets);
b_replace(b, b[(q + y) / 2 + (p + x) / 2,] = ' ');
if (p == x) {
b_replace(b, b[(q + y) / 2 + p - 1,] = ' ');
b_replace(b, b[(q + y) / 2 + p + 1,] = ' ');
}
}
Line 394 ⟶ 375:
grid_maze(b, N);
walk_maze(b, N);
o_text(b_stringo_(b));
return 0;
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.