This problem should be easier than the one we already have (Maze Mapping Robot) - for two reasons:
Actually it is re-implementation of the first exercise from the contest held by MTS mobile operator in the fall of 2024. Your goal is to crawl over whole maze and submit its precise map for verification.
Use maze1
for GAME-NAME (with the common url found in instruction above).
Maze of N*N
size consists of square cells. Each cell can have passages in any of 4
walls: north
, east
, south
, west
- we use this
order of directions everywhere. Axis X
goes in west-east
direction. Axis Y
goes in north-south
direction.
You start at the lower-left corner, that is south-western
, its coordinates are X=0, Y=N-1
(from which you know the size of the maze).
You send commands forward
to move forth, backward
to move back, left
and right
to turn 90
degrees. Response contains your coordinates,
direction (as value 0 .. 3
according to the order given above, actually clockwise) - and also values from sensors which inform you whether
there are passages or walls around you (front
, left
, right
, back
).
When you crawl over all the maze, send command guess
and additional parameter matrix
with the value, describing the maze cells in the following
form:
46aaec4-7d2ad15-516efad-785152d-7c38785-5786bc1-1383838
Here are hexadecimal digits - each of them describing one cell. The very first is for X=0, Y=0
, the next for X=1, Y=0
and so on, row by row
(with rows separated by dashes to improve visibility).
Every cell's digit is constructed simply as bitmask - if there is a passage in some direction, you set corresponding bit to 1
. For example
if there is only passage to the east
(direction 1
) the cell is described with digit 2
(binary 0010
). If there are passages to the
south
and west
(directions/bits 2
and 3
) the digit should be c
(binary 1100
) and so on.
To restart the game you, as usually, send only token without any command.
We send to start the game:
token: blahblahblahblah
Server answers:
x: 0
y: 6
dir: 0
front: 1
right: 1
back: 0
left: 0
steps: 0
I.e. there are passages both forward and right.
We send then command to move forward:
token: blahblahblahblah
cmd: forward
And server updates position and responds:
x: 0
y: 5
dir: 0
front: 1
right: 0
back: 1
left: 0
steps: 1
Now let's pretend we already mapped the maze and try to give the answer (obviously wrong - no passages at all in it):
token: blahblahblahblah
cmd: guess
matrix: 0000000-0000000-0000000-0000000-0000000-0000000-0000000
Server says the game is ended with loss and discovers the form of the maze:
end: game is lost
msg: expected:4444444-579d555-7945555-783d3d5-5445479-557bbbc-3bbaa81
Good luck!
We are likely to introduce limit on number of moves and time in the nearest future, but let's collect some attempts statistics first.