Back to Freecodecamp

Step 1

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

latest761 B
Original Source

--description--

In this project, you will solve the mathematical puzzle known as the Tower of Hanoi. The puzzle consists of three rods and a number of disks of different diameters.

The goal of this puzzle is moving the disks from the first rod to the third rod, following specific rules that restrict placing a larger disk on top of a smaller one.

Start by creating an empty dictionary named rods to represent the rods.

--hints--

You should have a variable named rods.

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

Your rods variable should be an empty dictionary.

js
({ test: () => assert(runPython(`
    rods == {}
  `))
})

--seed--

--seed-contents--

py
--fcc-editable-region--

--fcc-editable-region--