Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nathan-cav/maze-playground
Webpage application for testing maze algorithms. Built with p5.js
https://github.com/nathan-cav/maze-playground
Last synced: 5 days ago
JSON representation
Webpage application for testing maze algorithms. Built with p5.js
- Host: GitHub
- URL: https://github.com/nathan-cav/maze-playground
- Owner: Nathan-Cav
- Created: 2024-06-24T08:24:30.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-05T06:09:01.000Z (3 months ago)
- Last Synced: 2024-11-09T17:18:56.795Z (2 months ago)
- Language: JavaScript
- Homepage: https://nathan-cav.github.io/maze-playground/
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Maze Playground
Webpage application for testing maze algorithms. Maze algorithms are defined in `./algorithms`.
The application can be run at https://nathan-cav.github.io/maze-playground/ or by downloading the repo and opening `index.html` in the browser.
## Config
Configuration for defining the maze is located in `./maze_configs`. The numbers for the maze are:
``` javascript
0: Wall
1: EmptyCell
2: StartCell
3: CheizCell
```Walls are defined by every even row and column in the maze.
### Direction
The current cell moves in a particular direction which can change when `turnLeft()` and `turnRight()` are called. This direction is defined using the `currDirection` variable which is between 0-3. The directions are defined as
``` javascript
0: North
1: East
2: South
3: West
```The starting direction of the cell must be defined with the `currDirection` variable in `./maze_configs`.
## Movement Functions
The functions for movement and wall detection are the following.
### moveForward()
Move forward relative to the direction we're facing.
### turnLeft()/turnRight()/turnAround()
Change the direction we're facing.
## Sight Functions
### isWall(direction)
Whether we have reached a wall in a particular direction relative to the direction we're facing.
### cheeseIsThere()
Whether we're currently on a cheese cell.