Maze generation: Difference between revisions

Content added Content deleted
Line 1,786: Line 1,786:


=={{header|Commodore BASIC}}==
=={{header|Commodore BASIC}}==
Written in Commodore BASIC V2 and tested on Commodore 64 and Commodore 128 hardware. (It will also run on the unexpanded Commodore VIC-20 if you reduce the maze size to 8x8.) Due to stack size limitations in the operating systems, this example eschews recursive subroutine calls and it implements its own stack for variables. Recursion is accomplished, after a fashion, with branching within the main "build" routine.
Written in Commodore BASIC V2 and tested on Commodore 64 and Commodore 128 hardware. (It will also run on the unexpanded Commodore VIC-20 if you reduce the maze size to 8x8.) Due to stack size limitations in the operating systems, this solution eschews recursive subroutine calls. Recursion is accomplished by conditional branching within the maze build routine and the use of an array-based stack for data elements.


<lang BASIC>100 MS=10:REM MAZE SIZE
<lang BASIC>100 MS=10:REM MAZE SIZE