algorithms-edu 0.2.0

Algorithms for pedagogical demonstration
Documentation
A = [5, 4, 3, 2, 1]
B = []
C = []


def move(n, source, target, auxiliary):
    if n > 0:
        # Move n - 1 disks from source to auxiliary, so they are out of the way
        move(n - 1, source, auxiliary, target)

        # Move the nth disk from source to target
        target.append(source.pop())

        # Display our progress
        print(A, B, C, '##############', sep='\n')

        # Move the n - 1 disks that we left on auxiliary onto target
        move(n - 1, auxiliary, target, source)


# Initiate call from source A to target C with auxiliary B
move(3, A, C, B)