domingo, 1 de marzo de 2009


Moving missionaries and the cannibals smoothly


HOME ALGORITHM


we have to board a lake 3 cannibals and 3 missionaries who have to move to another part of the lake, the process will be as follows for those who are not cannibals eat the missionaries.


To push the boat click on the GO button, and ride the cannibals and missionaries andalusia boat you click on them.

1* is mounted to the boat a cannibal and a missionary are to Part B of the lake is low and the cannibal, the missionary returned to part A of the lake.

2 * To be a missionary in the lower part of the lake where 2 missionaries, cannibals and 2, then ride the boat and go 2 cannibals to Part B of the lake is another cannibal is low and is a cannibal returns to the other part of the lake.

3 * It lowers the cannibal in Part A of the lake and the boat ride is 2 missionaries, go to Part B of the lake is low and is mounted 1 missionary cannibal 1, then 2 is returned to the part of the lake.
4* When they kicked the missionary and the cannibal, the cannibal is low and is mounted on the last mission, then the 2 missionaries go to part B of the lake, there are 2 lower mounts missionaries and cannibalism.

5 * This cannibal becomes part of the lake and pick up another cannibal, what leads to part B of the lake is low and the other 1 cannibal back for the last cannibal who is in Part A of the lake, then these 2 go to Part B of the lake and down the 2. Thus passed 3misionero and 3 cannibals that if there were no problems


END ALGORITHM

No hay comentarios:

Publicar un comentario