Anonymous user
Maze generation: Difference between revisions
m
→{{header|D}}: added start and end
m (→{{header|D}}) |
m (→{{header|D}}: added start and end) |
||
Line 109:
void print() {
maze[0][0].m &= ~north;
maze[h-1][w-1].m &= ~east;
for (int r = 0; r < h; r++) {
auto hori = appender("");
auto vert = appender("");
for (int c; c < w; c++) {
if (maze[
if (c == w - 1) hori.put("+---+"); else hori.put("+---");
} else {
if (c == w - 1) hori.put("+ +"); else hori.put("+ ");
}
if (maze[
if (c ==
} else {
if (c ==
}
}
Line 131 ⟶ 134:
}</lang>
<pre>+
| | |
+
| | |
+ +
| |
| | |
+
|
+ + +---+
| | | | |
+ +---+ +---+
| | | |
+ + +---
| | |
+---+---+---+---+---+---+---+---+---+---+---+</pre>
|