how to not "maze over"?
there is an API though you can control your steps, but you can only access it if you have already registered
(if not please register here).
the API is secured with a HTTP basic authentication, so do not forget to include your credentials with every API call.
for your convenience i also generated a swagger documentation which you can check out here.
of course you can use any any programming language you want.
- create a maze -
POST - /api/mazes
making a post call with an empty body will let you start the maze.
you will find yourself at the entrance and as a response you will get the id of your maze.
this is when the door is closed behind you and you light your torch so your 3600 seconds starts.
if you would like to specify the level of the maze, you can choose from 3: STARTER - 7 x 7, ADVANCED - 15 x 15 or EXPERT - 31 x 31. add the name of the level as a request parameter name 'level'
- get info -
GET - /api/mazes/{id}
you can get some general data about your maze.
you will see the number of coins you collected, the bumps you made, the seconds you have left and a status.
you will also be able to check the time you started the maze.
- get cells around you -
GET - /api/mazes/{id}/steps
with your torch you can see the cells around you. there are 5 directions (NORTH, EAST, SOUTH, WEST, ON)
and 5 different cell types (EMPTY, COIN, WALL, ENTRANCE, EXIT).
it will return the same cells as long as you are at the same position.
- step -
POST - /api/mazes/{id}/steps
put a direction into the request body (NORTH, EAST, SOUTH, WEST, ON) and you made your step.
do not forget that if you bump into a wall, you will lose all the coins you've already collected.
to finish the game you will have to step to the exit.
- pick up a coin -
POST - /api/mazes/{id}/coins
if you are standing on a coin you can pick it up.
to be able to see the exit you will have to collect 3 coins.
- give up -
DELETE - /api/mazes/{id}
if you feel that you will not be able to get out of the maze in time then you can give up.
you can do this any time you want.
questions
please feel free to contact me if you have a question: info [at] floppylab [dot] com
i will be happy if you share your opinion, ideas about it, too! :)
if you would like to send me your code, git repo, do it! :)