? Maze Generator ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password
💀

Maze Generator

Submitted
Updated
Author
MCGamer20000
Public Key
D3EEF3LJ
Min. Compat.
All
Size
10201 bytes
Rating
4 votes
Description 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.
Categories
Keywords
3 Comment(s) Ptcguy Ptcguy First Week Joined in the very first week of SmileBASIC Source Website Minecraft Is Awesome! I love Minecraft! Express Yourself Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Really cool! This smashes my maze work-in-progress to bits! UFO_Pilot UFO_Pilot Just tried it out. Fun game. Do you know of any good tutorials for generating mazes in programs? MCGamer20000 MCGamer20000 Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Minecraft Is Awesome! I love Minecraft! Express Yourself First Month Joined in the very first month of SmileBASIC Source Website 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.