Solutions for the Missionaries and Cannibals Problem.
In this problem, three missionaries and three cannibals must cross a river using a boat which can carry at most two people, under the constraint that, for both banks, if there are missionaries present on the bank, they cannot be outnumbered by cannibals (if they were, the cannibals would eat the missionaries). The boat cannot cross the river by itself with no people on board. And, in some variations, one of the cannibals has only one arm and cannot row. [source: Wikipedia]
- 3.5 Problem: Missionaries and Cannibals Here is a old puzzle from the 1800s: “Once upon a time, three cannibals were guiding three missionaries through a jungle.
- Missionaries & Cannibals game solution. 3 years ago 28 views. Missionaries & Cannibals game solution. Report this video. Select an issue. Sexual content; Violent content; Defamation or Hateful content; Fake news story; Embed the video. Missionaries & Cannibals game solution.
2.1 Cannibals and Missionaries; The Cannibals and Missionaries problem: Three cannibals and three missionaries come to a crocodile infested river. There is a boat on their side that can be used by either one or two persons. If cannibals outnumber the missionaries at any time, the cannibals eat the missionaries. Cannibals missioneries plastelina logic solution to plastelina frogs logic puzzle family bridge crossing logic game solution. Cannibals Missioneries Plastelina Logic You Solution To Plastelina Frogs Logic Puzzle You. Solution To The Problem Missionaries And Cannibals Game Tips Still Loading Game 5 Ed Of Floor Please Help These.
Solutions
The problem was solved using three different languages: Java, Python and Prolog:
Java
A
State
class saves the current state of the problem, that is, how many missionaries and cannibals are in each side of the river and where is the boat (left or right).The
generateSuccessors
method checks the actions (e.g. cross a two missionaries from left to right) that can be applied to a particular state and returns the valid successor states.The initial state of the problem is passed as input to the bread first search algorithm (class
BreadthFirstSearch
) that returns the solution to the problem.The Java solution can be found in the java folder. You can use the jar executable file to run it:
Prolog
First was defined the 10 rules that determine which are the possible successor states for each possible action. Then a recursive rule
path
is responsible for find the solution of the problem.Running the Prolog code in SWI-Prolog:
Python
The Python solution is similar to the Java one. A
State
class saves the current state of the problem. The successors
method checks the actions that can be applied to each state. And the breadth_first_search
method returns the solution to the problem.Running the Python solution:
Cannibals & Missionaries is a challenging and addicting problem-solving game. Help the 3 missionaries and 3 cannibals to move to the other side of the lake using the boat provided. Note that when there are more cannibals on one side than missionaries, the cannibals eat the missionaries. How long will it you take to solve this problem? Don't let the missionaries be eaten by the hungry cannibals!
How to Play: Using your computer mouse, click on a cannibal / missionary to put him on the boat. Click on the 'Go' button at the top of the game screen to row the boat across the lake in order to move the cannibals and missionaries across to the other side of the lake. Note that there should be one or two people on the boat when going forwards and at least one when going backwards.
If this Flash-based game no longer works on IE11 on your PC / MAC, try playing on Chrome or Firefox browser.
Cannibals And Missionaries Code
Some helpful links to share include Top 100 Games, Top New Games & Latest Games. Enjoy!
Cannibals & Missionaries players also like to play these games on Learn4Good:
Think Tanks
Solution For Cannibals And Missionaries Games
3d puzzle game – Interlocked