Is there a way to convert a recursive Prolog code block into a DFS implementation for a Missionaries and Cannibals problem?
I’m… perhaps trying to learn how to use Prolog. Currently I’m attempting to solve the Missionaries and Cannibals problem – where you need to move 3 missionaries and 3 cannibals across a river and if the cannibals ever outnumber the missionaries, they eat them. A boat can be used to cross the river, and up to two people can use that boat (it needs at least 1 person on it in order to move from one side of the river to the other).