https://github.com/open-source-community/mazerunner
A simple maze game that uses the user's code to move the tank
https://github.com/open-source-community/mazerunner
Last synced: about 1 year ago
JSON representation
A simple maze game that uses the user's code to move the tank
- Host: GitHub
- URL: https://github.com/open-source-community/mazerunner
- Owner: Open-Source-Community
- Created: 2018-04-23T21:28:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-26T12:49:48.000Z (about 8 years ago)
- Last Synced: 2025-04-22T12:12:36.629Z (about 1 year ago)
- Language: JavaScript
- Size: 2.13 MB
- Stars: 4
- Watchers: 7
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MazeRunner
A simple maze game that uses the user's code to move the tank
Game Link : [Game](https://open-source-community.github.io/MazeRunner/mazestuffs/maze%20rendring/index.html)
## How To Play:
- There are 5 main functions
- ``` toty.movright(); ``` Moves the tank one block right.
- ``` toty.movleft(); ``` Moves the tank one block left.
- ``` toty.movup(); ``` Moves the tank one block up.
- ``` toty.movdown(); ``` Moves the tank one block down.
- ``` toty.isBlock(str) ``` Checks if the given direction has a block or not, for example if str equals 'right' and on the right of the tank there is a block then the function will return true.
- ``` toty.isWin(str) ``` Checks if the given direction is the winning block or not.
- Use recursive algorithms to solve any maze using the ```isBlock()``` and ```isWin()``` functions to create a generic algorithm, be creative.
- If you solved it try forking this repo and adding a screenshot of your submission code in the submission folder and pull request it, best answers shall be displayed.
## Code example
- This code is not generic, it just solves the first maze, you can copy and run it to test how the tank moves.
``` javascript
var d = function(a)
{
toty.movdown();
}
var r = function(a)
{
toty.movright();
}
var a =[6,6,1,1,1,2,1];
var b=[d,r,d,r,d,r,d];