ALGORITHM FOR THE SATISFACTION OF GAME CANNIBAL
VARIABLES: Cannibal (C1, C2, C3), monks, (M1, M2, M3), CANOA, SIDE A LADO B
To start the game press the PLAY button. I have three cannibals and three missionaries who want to cross the river, but the cannibals eat the missionaries, it depends on the number of missionaries who have depended on their side. The cannibal or the missionary who first must get into the canoe to another to complete the journey. (Note that on both sides of the river should not be more cannibals missionaries who, as the cannibals would eat the missionaries should be provided on both sides of the river. To move the canoe from side to side should click GO in this way can be moved from A andalusia Lada Lado B)
HOME
Make lick on PLAY to start
Click GO to start
While at A side
Give canoe C1 and C2
Side B starts up
Reach B side
When side B, down to C2
C1 is returned to side A
A hand reaches andalusia
Climb C3
C1 and C3 are returned to side B
Reach B side
C3 was low
C1 is returned to side A
A reaches lada A
C1 Low
M1 and M2 is rising
Pulled up beside B
Reach B side
M2 is low and rises C2
M1 and C2 are returned by side
Reach side A
C2 is low and rises M3
M1 and M3 pulled up beside B
Reach B side
M1y M3 down
Already M1, M2, M3, side B
C3 starts to go up side A
A hand reaches
Climb C2
C2 and C3 side B starts up
Reach B side
C2 is lowered
C3 is returned to side A
A hand reaches
Climb C1
C1 and C3 pulled up beside B
Reach B side
C1 and C3 are lowered
And are C1, C2 and C3 on B side
End
0 comentarios:
Publicar un comentario