Recursion in Basic on Commodore 64 – The Tower of Hanoi
But is it possible to write a program in Basic for the Commodore 64 that uses the recursion technique? Today we will talk about Basic programming for the Commodore 64 and recursion and to do so we will borrow the famous game of the Tower of Hanoi. One of the most famous algorithms that is taught in schools that uses the recursion technique is precisely the one that solves the problem of the puzzle of the Tower of Hanoi. Today I will create three programs for you in the first part of the video so I will show you how to create a graphics engine to manually play the Tower of Hanoi so you can practice and also have fun. In the second part of the video instead I will write a program that solves the puzzle of the Tower of Hanoi using the recursion technique. Finally in the third and final part I will combine the two programs creating a single one that will allow you to both play and see the solution.