def userMove(): global height move = int(raw_input("How many: ")) if move < 1 or move > height/2: return (height, False, True) else: height = height - move return (height, True, height - move == 1) def hanoi(n, source, target, using): if n == 1: print source, "--->", target else: hanoi(n-1, source, using, target) print source, "--->", target hanoi(n-1, using, target, source)