Back to Freecodecamp

Step 15

curriculum/challenges/english/blocks/learn-recursion-by-solving-the-tower-of-hanoi-puzzle/64e33a488b4a2717fa22ebf3.md

latest706 B
Original Source

--description--

Add another comment before your print() call saying display starting configuration.

--hints--

You should use the provided text to add a comment before your print() call.

js
({ test: () => assert.match(code, /#\s*display\sstarting\sconfiguration\s+print\s*\(\s*rods\s*\)/) })

--seed--

--seed-contents--

py
NUMBER_OF_DISKS = 3
number_of_moves = 2**NUMBER_OF_DISKS - 1
rods = {
    'A': list(range(NUMBER_OF_DISKS, 0, -1)),
    'B': [],
    'C': []
}

--fcc-editable-region--
def move(n, source, auxiliary, target):
    
    print(rods)
--fcc-editable-region--

# initiate call from source A to target C with auxiliary B
move(NUMBER_OF_DISKS, 'A', 'B', 'C')