This is a challenge that requires you to construct a program that will complete a maze. Your program may access each step of the maze from a URL which returns information encoded in JSON format. This information includes the following:
letter
: the letter corresponding to this step within the mazeadjacent
: an array of objects encoding x
and y
coordinates for steps
that are immediately adjacent to this stepend
: if the current step is the end, this value will be true
. Otherwise
it is false
.The URL is located at /step
and has the following parameters:
x
: the x coordinate of the stepy
: the y coordinate of the steps
: the maze identifier, this parameter should be kept constant between step
requests for the same maze/start
will redirect your program to the (0, 0)
coordinate of a
new random maze.
Your goal is to write a program that begins at the /start
URL and
traverse the maze until you reach the step where end is true
. You should
record each letter at each step in the path and print the resulting string at
the end of your program.
You may check your solution by calling /check
with s
set to the
maze identifier and guess
set to the string your program thinks is a
potential solution.
For example: pqkefzvymrbtfqntnqkrdipik
is a solution for maze identifier
123456.5
. The check endpoint returns a successful response for:
/check?s=123456.5&guess=pqkefzvymrbtfqntnqkrdipik
.
Note that another, shorter solution is also possible for this identifer
pqkefzvymrbtfqkrdik
.
a
and (1,2) is set to b
, if your program
traverses from (1,1) to (1,2) then back (1,1), the solution string should
contain aba
for that segment./check
endpoint described above.Submit your solution to internships[at]flipboard[dot]com