Maze generation: Difference between revisions

Line 1,050:
// draw the north edge
for (int j = 0; j < x; j++) {
System.out.print(((maze[j][i] & 1) == 0) ? "+---" : "+ ");
}
System.out.println("+");
// draw the west edge
for (int j = 0; j < x; j++) {
System.out.print(String.format("%s ",
((maze[j][i] & 8) == 0 ? "|" : " "), maze[j][i]));
}
Line 1,062:
// draw the bottom line
for (int j = 0; j < x; j++) {
System.out.print("+---");
}
System.out.println("+");
Line 1,126:
</lang>
<lang>
+---+---+---+---+---+---+---+---+---+---+
| | | | | |
+ + + + ---+---+ +---+---+ + + +---+
| | | | | | | | |
+--+--+--+--+ +-- + + +---+ +---+ +
| | | | | | |
+ +---+---+ +---+ +-- +--+--+-- + +
| | | | | | | |
+-- + +-- + +---+ +--+--+---+---+ + +
| | | | | | |
+ + + +--+--+-- + +---+---+ + +---+---+
| | | | | | | |
+ +---+ + +---+ +---+---+ + + + + +
| | | | | | | |
+---+ +-- +---+ + +---+--+ -+---+ +
| | | | | | |
+ +-- +--+--+ + +---+---+ +--+--+ +
| | | | | | | |
+ +--+--+ + +---+---+ + + + +
| | | |
+---+---+---+---+---+---+---+---+---+---+
</lang>
 
Anonymous user