Towers of Hanoi in BASIC

Post Reply
MarkTheStrange
Posts: 17
Joined: Sat Nov 26, 2022 6:24 pm

Towers of Hanoi in BASIC

Post by MarkTheStrange »

Thought this would make a relatively simple demo of what you can do with BASIC. It loads some sprites into memory and draws some pegs and then animates the solution for the 8-disc Towers of Hanoi puzzle. The solution part uses recursion via global arrays functioning as "stacks" for each "local" variable.

Image

Try It Now!
Attachments
hanoi.bas
(29.73 KiB) Downloaded 6 times
hanoi.prg
(9.81 KiB) Downloaded 7 times
Last edited by MarkTheStrange on Wed Apr 17, 2024 9:21 pm, edited 1 time in total.
mortarm
Posts: 232
Joined: Tue May 16, 2023 6:21 pm

Re: Towers of Hanoi in BASIC

Post by mortarm »

Ah, an olde but a goodie. I remember seeing that program back in the '70s when I was using a Decwriter.
Post Reply