Page 1 of 1

Towers of Hanoi in BASIC

Posted: Sat Jan 20, 2024 4:45 am
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!

Re: Towers of Hanoi in BASIC

Posted: Mon Jan 22, 2024 1:39 am
by mortarm
Ah, an olde but a goodie. I remember seeing that program back in the '70s when I was using a Decwriter.