LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Maze Generator

Root / Submissions / [.]

MCGamer20000Created:
Download:D3EEF3LJ
Version:Size:10201 bytes
Maze generator using the same technique as Maze Daze for PTC, but now it returns a start point and an end point. The program also includes two sample games where you run through a maze, one 2D and one 3D (using GAME2RPG's engine).

Instructions:

DIM MAZE[0] LOAD "PRG1:MAZE" USE 1 MAZE WIDTH, HEIGHT OUT MAZE, STARTX, STARTY, ENDX, EBDY MAZE array will be replaced with the results, regardless of array size. MAZE array size will be WIDTH×2-1 by HEIGHT×2-1. Width and height does not include the walls in the middle, explaining the array size.

Just tried it out. Fun game. Do you know of any good tutorials for generating mazes in programs?

Really cool! This smashes my maze work-in-progress to bits!

Replying to:UFO_Pilot
Just tried it out. Fun game. Do you know of any good tutorials for generating mazes in programs?
You can just use the MAZE instruction in the program. There's instructions on the top of this page. The way this code works: It picks a random place on the grid to start from and adds it to the list of coordinates. It'll repeatedly pick a random direction to go, adding each point to the list. Once it has nowhere to go, it will delete the latest coordinates from the list, go back, and try the find a new point from there. The code ends once it backtraces to the starting point, meaning that all points on the grid will have been filled.