Alex Ribeiro

Spain

def hanoi(n, o, d, a):
    if n == 1:
        print(o+" -> "+d)
    else:
        hanoi(n-1, o, a, d)
        print(o+" -> "+d)
        hanoi(n-1, a,d,o)


hanoi(5, "O", "D", "A")
Top Questions
No questions with score of 5 or more
Top Answers
No answers with score of 5 or more