Posted by
Leidy Yohana Jaramilo Lenis
In:
Algorithm brings over of cannibals and missionaries
¿at some time played bundle cannibal and missionary?.
Not, since it,proves the game cannibal and missionary do click in the link in order that you prove the game with the following algorithm.
If already, you played it risk verifying the forms that exist to give completion to the game by means of a practical algorithm.
Assignment it wants to say this arrow =>
For this algorithm bear in mind that you can never leave in one of the sides cannibals' major quantity since these will devour to them the missionaries.
Beginning
In the side A => A the boat two passengers Transporta the boat towards the side B
In the side B => goes down the boat a passenger returns the boat towards the side A minimum with a passenger
But
Go was not activating you if you do not transport at least a passenger
If from the side B you return the cannibal and in the side A there are fewer missionaries at the time
End
You have two options
If in the boat you stopped the missionary at the time
In the side A fall of the boat the missionary => boat two cannibals Transporta the boat towards the side B
But
If in the boat you transported two cannibals at the time
In the side A => boat the cannibal who is absent
It transports the boat towards the side B returns the boat towards the side A minimum with a passenger
From the side A fall of the boat the cannibal => boat two missionaries Traslada the boat towards the side B and a missionary goes down.
In the side B a missionary stops in the boat => boat a cannibal and it, returns to the side A.
Transports towards the side the missionary and the cannibal.
In the side A fall the cannibal and the missionary stops in the boat => boat the remaining missionary
Moves both missionaries towards the side B
In the side A fall the cannibal and the missionary stop signs in the boat => boat the remaining missionary
Moves both missionaries towards the side B
In the side A => remaining cannibal
Transports the boat towards the side B and goes down the cannibals of the boat
End
Finally, "Congratulations" you have managed to cross all and have gained the game of logic Cannibals.
This entry was posted on 13:44
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
Posted on
-
0 Comments
Suscribirse a:
Enviar comentarios (Atom)
0 comentarios:
Publicar un comentario