In this puzzle, there are
missionaries and
cannibals on the
one bank of a river, together with a boat that can carry
passengers. Initially,
. The object is to reach a state in
which all missionaries and cannibals are on the West bank of the
river. The difficulty is that if the missionaries ever outnumber the
cannibals on either side of the river, that group of missionaries eats
their unfortunate cannibal associates1. To successfully solve the puzzle, no
cannibals may be devoured.
A MOVE consists of selecting a group of one or more passengers to load in the boat, rowing the boat across the river, and unloading the boat on the other side. Note that the boat cannot cross the river with no passengers and the boat cannot carry more passengers than its capacity. The river is full of hungry piranha and anybody attempting to swim will be devoured. The boat MUST be fully unloaded on the far side of the river, at which point the assessment of conversions is performed.
For the purposes of output, a MOVE is represented by:
MOVE
: FERRY
Cannibals and
Missionaries FROM
TO
where
and
denote the number of cannibals and missionaries
relocated during this move, respectively, and
and
denote
the initial and final sides of the river.
and
and
.
The output of a state is the same as the input format, specified by the rule MCSTATE in Section 3.2.
The null move (moving no people) is disallowed.
Terran Lane 2004-03-24