970 likes | 1.33k Views
Tower of Hanoi. Members. 1.Krit Chandrema M.2/1 No.1 2.Pongsakorn S urapongwanitchakul M.2/1 No.5 3.Arituch Chainilpan M.2/1 No.16 4.Parit Prompuntjai M.2/1 No.27. Pseudo code. 1. Start 2. 5 rings and 3 bars 3. Which bar will we move ring 1 to 4. Bar C 5. Ring 1 in the bar C
E N D
Members • 1.Krit Chandrema M.2/1 No.1 • 2.Pongsakorn Surapongwanitchakul M.2/1 No.5 • 3.Arituch Chainilpan M.2/1 No.16 • 4.Parit Prompuntjai M.2/1 No.27
Pseudo code • 1. Start • 2. 5 rings and 3 bars • 3. Which bar will we move ring 1 to • 4. Bar C • 5. Ring 1 in the bar C • 6. Which bar will we move ring 2 to • 7. Bar B • 8. Ring 2 in the Bar B
9. Which bar will we move ring 1 to • 10. Bar B • 11. Ring 1 in the bar B • 12. Which bar will we move ring 3 to • 13. Bar C • 14. Ring 3 in the bar C • 15. Which bar will we move ring 1 to • 16 . Bar A • 17. Ring 1 in the bar A • 18. Which bar will we move ring 2 to • 19. Bar C • 20. Ring 2 in the bar C
21.Which bar we will move ring 1 to? • 22.Bar C • 23.Ring 1 in the bar C • 24.Which bar will we move ring 4 to? • 25.Bar C • 26.Ring 4 in the bar BC • 27.Which bar will we move ring 1 to? • 28.Bar A • 29.Ring 1 in the bar A • 30.Which bar will we move ring 2 to? • 31.Bar B • 32. Ring 2 in the bar B
33.Which bar will we move ring 1 to? • 34.Bar B • 35.Ring 1 in the bar B • 36.Which bar will we move ring 3 to? • 37.Bar A • 38.Ring 3 in the bar A • 39.Which bar will we move ring 1 to? • 40.Bar A • 41.Ring 1 in the Bar A • 42.Which bar will we move ring 2 to? • 43. Bar C • 44.Ring 2 in the bar C
45.Which bar will we move ring 1 to? • 46.Bar C • 47.Ring 1 in the bar C • 48.Which bar will we move ring 3 to? • 49.Bar B • 50.Ring 3 in the bar B • 51.Which bar will we move ring 1 to? • 52.Bar A • 53.Ring 1 in the bar A • 54.Which bar will we move ring 2 to? • 55.Bar B • 56.Ring 2 in the bar B
57.Which bar will we move ring 1 to? • 58.Bar B • 59.Ring 1 in the bar B • 60.Which bar will we move ring 5 to? • 61.Bar C • 62.Ring 5 in the bar C • 63.Which bar will we move ring 1 to? • 64.BarA • 65.Ring 1 in the bar A • 66.Which bar will we move 2 to? • 67.Bar C • 68.Ring 2 in the bar C
69.Which bar will we move 1 to? • 70.Bar C • 71.Ring 1 in the bar C • 72.Which bar will we move 3 to? • 73.Bar A • 74.Ring 3 in the bar A • 75.Which bar will we move ring 1 to? • 76.Bar B • 77.Ring 1 in the bar B • 78.Which bar will we move ring 2 to? • 79.Bar A • 80.Ring 2 in the bar A
81.Which bar will we move ring 1 to? • 82.Bar A • 83.Ring 1 in the bar A • 84.Which bar will move ring 4 to? • 85.Bar C • 86.Ring 4 in the bar C • 87.Which bar will we move ring 1 to? • 88.Bar C • 89. Ring 1 in the bar C • 90.Which bar will we move ring 2 to? • 91.Bar B • 92.Ring 2 in the bar B
93.Which bar will we move ring 1 to? • 94. Bar B • 95. Ring 1 in the bar B • 96. Which bar will we move ring 3 to? • 97.Bar C • 98.Ring 3 in the bar C • 99.Which bar will we move 1 to? • 100.Bar A • 101. Ring 1 in the bar A • 102.Which ring will we move ring 2 to? • 103.Bar C • 104.Ring 2 in the bar C
105.Which bar will we move ring 1 to? • 106.Bar C • 107.Ring 1 in the bar C • 108.Win • 109.End
Start 5 rings and 3bars Which bar we will move ring 1 to? NO YES Bar C Bar B Ring 1 in the bar C
Which bar we will move ring 2 to? YES NO Bar C Bar B Ring 2 in the bar B
Which bar we will move ring 1 to? YES NO Bar C Bar B Ring 1 in the bar B
Which bar we will move ring 3 to? YES Bar C Bar B Ring 3 in the bar C
Which bar we will move ring 1 to? YES Bar B Bar A Ring 1 in the bar A
Which bar we will move ring 2 to? YES NO Bar C Bar B Ring 2 in the bar C
Which bar we will move ring 1 to? YES NO Bar C Bar B Ring 1 in the bar C
Which bar we will move ring 4 to? NO YES Bar C Bar B Ring 4 in the bar B
Which bar we will move ring 1 to? YES NO Bar B Bar A Ring 1 in the bar A
Which bar we will move ring 2 to? YES NO Bar C Bar B Ring 2 in the bar B
Which bar we will move ring 1 to? YES NO Bar C Bar B Ring 1 in the bar B
Which bar we will move ring 3 to? YES NO Bar B Bar A Ring 3 in the bar A
Which bar we will move ring 1 to? YES NO Bar B Bar A Ring 1 in the bar A
Which bar we will move ring 2 to? NO YES Bar C Bar B Ring 2 in the bar C
Which bar we will move ring 1 to? NO YES Bar C Bar B Ring 1 in the bar C
Which bar we will move ring 3 to? YES NO Bar C Bar B Ring 3 in the bar B
Which bar we will move ring 1 to? YES NO Bar B Bar A Ring 1 in the bar A
Which bar we will move ring 2 to? YES NO Bar C Bar B Ring 2 in the bar B