Last active
June 5, 2022 15:30
-
-
Save PushkraJ99/9a4f36ed73faf5c38e636038d0e87344 to your computer and use it in GitHub Desktop.
Tower Of Hanoi Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Tower Of Hanoi (Github:-PushkraJ99) | |
| from tkinter import N | |
| def TOH(numbers, start, aux, end): | |
| if numbers ==1: | |
| print("Move Disk 1 From Rod {} to Rod {} ".format(start,end)) | |
| return | |
| TOH(numbers-1,start,end,aux) | |
| print("Move Disk {} From Rod {} to Rod {} ".format(numbers,start,end)) | |
| TOH(numbers-1,aux,start,end) | |
| TOH (disc,"A","B","C") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment