Anonymous user
Maze generation: Difference between revisions
Updated D code
(Go solution) |
(Updated D code) |
||
Line 817:
alias Tuple!(uint,"x", uint,"y") P;
void visit(in int x, in int y) {
seen[x][y] = true;
P[] D = [P(x-1,y), P(x+1,y), P(x,y-1), P(x,y+1)];
P[] ns = array(filter!((p){
while (ns.length) {
if (!seen[n.x][n.y]) {
visit(n.tupleof);
}
|