Skip to content

Instantly share code, notes, and snippets.

@Bablzz
Created Nov 20, 2019
Embed
What would you like to do?
Tower of Hanoi
def solve(n, a, b, c):
if n > 0:
solve(n - 1, a, c, b)
print('Move disk from ' + a + ' to disk ' + b)
solve(n - 1, c, b, a)
solve(3, '1', '2', '3')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment