Skip to content

maze-generator/maze-generator.github.io

Repository files navigation

Maze Generator

This app creates mazes for you to save as text.

The project was created @MakeSchool. You can find the project instructions here.

This project was refactored during an intensive period. You can find the intensive proposal here.

Usage

To use on your local machine, follow these instructions:

  1. download this project onto your machine (using git, or as a .zip, etc).
  2. run yarn in your terminal to download required npm packages.
  3. run yarn start to begin running the project locally in a browser.
  4. open the project in your browser at http://localhost:3000/

License

The code is released under the MIT License.

React.js

This project was bootstrapped with react. Check out its readme here.

Needed Functionality

SHAPE NEEDED

  • Maze.isIndexValid (id) -> (boolean)
  • Maze.areNeighbors (Array of IDs) -> (boolean)
  • Maze.getCoordinates (Array of IDs) -> (Coordinates)
  • Maze.getTensorSlice (Coordinates) -> (Array of IDs)
  • Maze.getNeighbors (id) -> (Record of Directions to IDs)

SHAPE NOT NEEDED

  • Cell.addNeighbor (id)
  • Cell.addPassage (id)
  • Cell.hasPath () -> (boolean)
  • Cell.hasWall () -> (boolean)

JSON Output

{
	"algorithm":"recursive breadth-first traversal",
	"map":{
		"dimensions":[
			3,
			2
		],
		"magnitudes":[
			1,
			3
		],
		"size":6,
		"data":[
			{
				"id":0,
				"status":"complete",
				"neighbors":{
					"east":1,
					"south":3
				},
				"passages":{
					"west":false,
					"east":false,
					"north":false,
					"south":true
				}
			},
			{
				"id":1,
				"status":"complete",
				"neighbors":{
					"west":0,
					"east":2,
					"south":4
				},
				"passages":{
					"west":false,
					"east":true,
					"north":false,
					"south":true
				}
			},
			{
				"id":2,
				"status":"complete",
				"neighbors":{
					"west":1,
					"south":5
				},
				"passages":{
					"west":true,
					"east":false,
					"north":false,
					"south":true
				}
			},
			{
				"id":3,
				"status":"complete",
				"neighbors":{
					"east":4,
					"north":0
				},
				"passages":{
					"west":false,
					"east":true,
					"north":true,
					"south":false
				}
			},
			{
				"id":4,
				"status":"complete",
				"neighbors":{
					"west":3,
					"east":5,
					"north":1
				},
				"passages":{
					"west":true,
					"east":false,
					"north":true,
					"south":false
				}
			},
			{
				"id":5,
				"status":"complete",
				"neighbors":{
					"west":4,
					"north":2
				},
				"passages":{
					"west":false,
					"east":false,
					"north":true,
					"south":false
				}
			}
		]
	},
	"compass":{
		"layout":"square",
		"rose":{
			"west":-1,
			"east":1,
			"north":-3,
			"south":3
		},
		"directions":[
			"west",
			"east",
			"north",
			"south"
		],
		"antipodes":{
			"west":"east",
			"east":"west",
			"north":"south",
			"south":"north"
		}
	}
}

About

🏺 mazes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •