Problem #251
Tags:
interactive
games
puzzle
artificial-intelligence
c-1
This is an interactive puzzle (make sure you solved some already) based
on a pencil-and-paper game, probably originating from Soviet students community. One of its
names is Fox Hunt
(after outdoor sports with the same name -
running around with directional receiver and searching for hidden radio-transmitters). Though I personally recollect
calling it Smersh - by association with famous novel/movie about
spy-hunting episode of WW2. We don't use the former name to avoid confusion with other similarly named games - and
the latter - due to somewhat negative connotations.
There is a square region of N*N
districts - and M
transmitters (aka stations) randomly placed in these districts (never
occupying the same cell). Transmitters have specially constructed antennas and emit signals in narrow rays, in 8
directions (vertically, horizontally and diagonally - as chess queen moves).
You can send radio-detecting car to any cell - its crew will report how many stations they detect in that place (but not their directions). Consider an example below:
8 - - - - - - - - 8 - 0 - - - - - -
7 - - - - - * - - 7 - - - - - - 3 -
6 - - - - - - - - 6 - - - - - - - -
5 - - * - - - - - 5 - - - 4 - - - -
4 - - - - - - - - 4 - - - - - - - -
3 - - - * - - - - 3 - - - - - - - -
2 - - - - - - * - 2 - - - - - - - -
1 * - - - - - - - 1 - - - - - - - 2
a b c d e f g h a b c d e f g h
On the left we see how 5
stations are placed in the 8*8
grid. On the right it is how we look at the "map",
not seeing the stations, mark four reports of the detector team from different places. For convenience we use
chess coordinates: in b8
we detect no signals, in d5
we hear 4 stations, then in g7
and h1
we observe
3
and 2
correspondingly.
We play on the grid 12*12
with 9
transmitters to be found.
Use radio-spies
for GAME-NAME (with the common url found in instruction above).
Send the token found in "input box" to the server, it will respond with the size of the grid and number of
transmitters set up in it (so you may avoid hard-coding these values). Then add the command square
with
coordinate to try to each following request:
we send: server responds:
-------- ----------------
token: blah-blah size: 12
spies: 12
attempts: 0
token: blah-blah here: 0
square: d4 stations: 4
attempts: 1
If the square to be tested contains transmitter in it, here
field is 1
(transmitter is counted with others).
Transmitters are not removed after being detected (so all previous values remain correct).
The attempts
counter is incremented on unsuccessful tries (i.e. it doesn't increment if you correctly guess
the cell with station).
Game ends automatically when all stations were found (e.g. their cells were visited at least once).
You can play manually (and of course it is recommended first). However on the game end you only receive
an "answer token" if attempt counter is less or equal to 24
- and if no more than 240
seconds elapsed
since the game start (initial request). Submit the answer token when you have it. Good luck :)