Maze generation: Difference between revisions

Content added Content deleted
(→‎version 1: changed order of subroutines, added whitespace and comments. -- ~~~~)
m (→‎version 1: changed some whitespace here and there. -- ~~~~)
Line 3,718: Line 3,718:
call buildRow '┌'copies('─┬',cols-1)'─┐' /*build the top edge of maze.*/
call buildRow '┌'copies('─┬',cols-1)'─┐' /*build the top edge of maze.*/
/*(below) build the maze's grid.*/
/*(below) build the maze's grid.*/
do r=1 for rows; _=; __=; hp= '|'; hj='├'
do r=1 for rows; _=; __=; hp= '|'; hj='├'
do c=1 for cols; _= _||hp'1'; __=__||hj'─'; hj='┼'; hp='│'
do c=1 for cols; _= _||hp'1'; __=__||hj'─'; hj='┼'; hp='│'
end /*c*/
end /*c*/
Line 3,745: Line 3,745:
_=changestr('─',_,"───") /*──────────── the aspect ratio. */
_=changestr('─',_,"───") /*──────────── the aspect ratio. */
say translate(_,'│',"|\10") /*make it presentable for screen.*/
say translate(_,'│',"|\10") /*make it presentable for screen.*/
end /*r*/
end /*r*/
exit /*stick a fork in it, we're done.*/
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────@ subroutine────────────────────────*/
/*──────────────────────────────────@ subroutine────────────────────────*/