No translations... yet

This is an interactive problem. Game description was found in the book "Programming of games and puzzles" by Jaques Arsac (fr) - and seems to be original invention of the author.

On the Shadok's planet situation is normal: rocket tests continue, failing every time. It is the main principle of Shadok's logic: Nothing can continue without ending with success. In other words - the more failures, the greater chance of it working at last.

Their rocket is very imperfect yet, but according to calculations the success probability is one per million - thus they hurry to perform 999999 unsuccessful tests to be sure the millionth shall fly.

(story seems to be based on Jaques Rouxel's Les Shadoks)

Great Shaman said the rockets fail due to insufficient number of transistors in the safety system. Transistors grew on special flowers at Gibi's planet. It is decided to send one of Shadoks to gather transistors.

Gibis are very clever because of their hats - and discovered the plan. They decided to have fun, and allowed the Shadok to sneak into one of their gardens. They then flooded the place themselves and every time some plant blossoms with transistors they rush to it to collect harvest first.

Problem Description

You control the Shadok and have a goal to gather 100 transistors in 40 moves (before the nightfall). The field is rectangular and looks like this:

- - 7 2 - - - - - - - - - - - - - - - - - - - -
- - - g g - - 1 - - - - - g - - - - 8 - - - - -
- - - - - - - - - - - - - - - - - - - 5 - - - -
- 2 - - - - - - - - g 5 - - - - - 7 - - - - - -
- - - - - - - - 1 - - 4 9 - - 7 - - - - - - - -
- - - - - - - 4 - - - - 8 - - - - - 2 - - - - -
- - - - - 5 - - 1 - - - - 6 g - - - - - - - - -
g - - - - - - - - - - - - 2 - g - - 7 - - - - -
- - - g - - - - - - - - 2 - - - - - g - g - - -
- - - g - - - - - - - - g - - - - - S - - - - g
- - - - - - - - - - 4 - - - - - - - - - - - - g
- - - g - - - - - - - - - - - - - 7 g - - - - -
- - - - - - - - - - - - - - - - - - - - 8 - - -
- - - - - g g - - g - - - - - - - - - 5 - - g 4
8 - 9 - - - - g - - g - - - - - - - - - - - - -
- - g - - - - - - - - - - 1 - - - - - g 6 - 5 4

Shadok is marked with S and Gibis with g. Digits represent the transistor plants ready to be harvested (number meaning how many transistors are ripe).

Shadok moves one step per turn in any of eight directions. If it moves into cell with the plant, it disappears and collected transistors counter is increased by relevant number. At the same time new plant reappears at some free cell.

Gibis move in the same manner. They simply run to the closest plant (randomly choosing one if several are equally close). Transistors collected by Gibis are not counted (this do not matter).

Technical details

Send the token to server using GAME-NAME shadok and the url found in the instruction on interactive puzzles.

With response you get values for moves and transistors. Also, the main part of response is value field - it gives text representation of the whole game space. Just split it into separate rows on semicolons.

To make move you add value move to the request, using letters L, R, U, D (or a couple of them, like LD for diagonal moves). If the move is incorrect (going out of borders, or one of Gibis is in the way, or wrong letters) - no error happens, just Shadok remains in the same place.

Gibis move one by one, in random order, after the Shadok's move is done. Sometimes they block each other's move. They do not coordinate their efforts, so if there are two flowers and two Gibis nearby, they may try to pick the same (and so probably give the Shadok time to get close to another).

To get the answer token game should be won in about 60 seconds from start (sending token without any move). Try playing manually first for better understanding of the details.

You need to login to get test data and submit solution.