WOLF, GOAT AND CABBAGE TRANSFER ACROSS THE RIVER ALGORITHM

€2.00
Tax included
Quantity

Farmer f needs to bring a wolf w, a goat g, and a cabbage c across the river. The boat is tiny and can only carry farmer with one other passenger at a time. If the wolf and the goat were left alone together, the wolf will eat the goat. If the goat and the cabbage were alone together, the goat will eat the cabbage. How farmer f can bring w, g and c safely across the river while w, g and c are unable to oar? Answer must be written into answer field.

Three dots means direction of the destination, for example: if farmer is sailing forward, then the input must be f... if backward, then ...f .

If sailing is made by more than 1 actor, they must be separated by comma, for example: if farmer and wolf are sailing forward, then input is f,w... if backward, then …f,w .

If input is made for several steps at a time, then they must be separated by space, for example: if farmer and wolf are sailing forward and farmer with goat are sailing backward, then input is f,w... …f,g .

For stepping back at the certain step, one must delete all steps before that step, for example: if after performing 4 steps u,w... ...u u,w... ...u,c it is a need to return to step 1, then 3 last steps ...u u,w... ...u,c are deleted while the 1-st step u,w... remains for input.

1999836 Items