Maze generation: Difference between revisions

Tweaked first D version
No edit summary
(Tweaked first D version)
Line 961:
alias Tuple!(uint,"x", uint,"y") P; // will wrap-around
auto d = [P(x-1, y), P(x, y+1), P(x+1, y), P(x, y-1)];
d.randomShuffle(d);
foreach (p; d) {
if (p.x >= w || p.y >= h || vis[p.y][p.x]) continue;
Anonymous user