Back to Freecodecamp

Step 8

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

latest950 B
Original Source

--description--

At the top of your code, declare a variable named NUMBER_OF_DISKS to store the number of disks and give it the value of 3. Then, replace the first argument passed in to the range() function with your new variable.

--hints--

You should declare a variable named NUMBER_OF_DISKS.

js
({test: () => assert(__userGlobals.has('NUMBER_OF_DISKS')) })

The NUMBER_OF_DISKS variable should have the value 3.

js
({test: () => assert.equal(__userGlobals.get('NUMBER_OF_DISKS'), 3) })

You should change the value of the range() function's first argument into the NUMBER_OF_DISKS variable.

js
({test: () => assert.match(code, /('|")A\1\s*:\s*list\s*\(\s*range\s*\(\s*NUMBER_OF_DISKS\s*,\s*0\s*,\s*-\s*1\s*\)\s*\)/) })

--seed--

--seed-contents--

py
--fcc-editable-region--

rods = {
    'A': list(range(3, 0, -1)),
    'B': [],
    'C': []
}
--fcc-editable-region--

def move():
    pass