This is the common problem where there are 3 explorers and 3 cannibals on one side of the river and they want to travel to the other side. The boat can only hold 2 people at a time, and if the cannibals ever outnumber the explorers on either side of the river, the cannibal will eat the explorer and the game is over.
This program explors all possible moves and prints out every sequence of moves that result in a successful game.