I-Tower of Hanoi iyindida yezibalo yakudala ephonsa inselelo kubadlali ukuthi bahambise isethi yamadiski anosayizi ohlukile ukusuka komunye umbhoshongo ukuya komunye, ngokulandela imithetho ethile. Umdlalo uqukethe imibhoshongo emithathu, eqale yapakishwa ngenani lamadiski ngosayizi onciphayo ukusuka phansi kuye phezulu kumbhoshongo owodwa. Inhloso ukuhambisa sonke isitaki komunye umbhoshongo, ngokuthobela le mithetho elandelayo:
1. Idiski eyodwa kuphela engahanjiswa ngesikhathi.
2. Umnyakazo ngamunye uhlanganisa ukuthatha idiski engenhla kwesinye sezitaki bese usibeka phezu kwesinye isitaki noma umbhoshongo ongenalutho.
3. Alikho idiski elingabekwa phezu kwediski elincane.
------------------------------------------------- ------------------------------------------------- ----------------------
Idlalwa kanjani:
1. Chofoza umbhoshongo ukuze uwukhethe.
2 .Chofoza komunye umbhoshongo ukuhambisa idiski ephezulu ukusuka embhoshongweni okhethiwe ukuya ku
uchofoze umbhoshongo, ngokulandela imithetho yomdlalo.
3. Zama ukuqedela iphazili ngezinyathelo ezimbalwa ngangokunokwenzeka.
------------------------------------------------- ------------------------------------------------- ----------------------
Inhloso:
Qedela iphazili ye-Tower of Hanoi ngokuhambisa wonke amadiski ukusuka embhoshongweni owodwa ukuya komunye ngenkathi unamathela emithethweni. Ziphonsele inselelo ukuze uthole isixazululo esisebenza kahle kakhulu ngenani elincane lokunyakaza.
Jabulela ukucabanga kwamasu nokuxazulula izinkinga okuhilelekile ekuxazululeni iphazili ye-Tower of Hanoi!
Kubuyekezwe ngo-
Jan 30, 2024