Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 684 Bytes

README.md

File metadata and controls

13 lines (8 loc) · 684 Bytes

Missionários e Canibais

In the missionaries and cannibals 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. (Wikipedia)

Python program for an arbitrary number of missionaries and cannibals.

How to run:

python3 main.py <missionaries> <cannibals> <size of boat>