Maze generation: Difference between revisions

Updated D entry
(→‎{{header|REXX}}: add Version 2)
(Updated D entry)
Line 1,563:
static struct P { immutable uint x, y; } // Will wrap-around.
auto d = [P(x-1, y), P(x, y+1), P(x+1, y), P(x, y-1)];
foreach (p; d.randomCover(unpredictableSeed.Random)) {
if (p.x >= w || p.y >= h || vis[p.y][p.x]) continue;
if (p.x == x) hor[max(y, p.y)][x] = "+ ";