Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.