kind = architecture
tests = 64
size = 255
default_architecture = "Symphony"
title = (31337_29450953142176, `Tower of Hanoi`)
dialogue = [
  (mentor_centered, (31337_23374750315066, `In the game "Towers of Hanoi", you must move a stack of disks from one peg to another. The challenge is that only one disk can be moved at a time, only the top disk on a stack can be moved, and a larger disk can never be placed on top of a smaller one.`)),
  (mentor_centered, (31337_72724057674158, `The first 4 inputs will give you the following in order:
disk_nr - The highest disk number in the pile (2 to 4)
source - Which location number to move from
destination - Where to move the pile to
spare - The 3rd spot that is neither the source nor the destination

Control the magnet with the following outputs:
[left]
                0 - Move the magnet to spot 0
                1 - Move the magnet to spot 1
                2 - Move the magnet to spot 2
                5 - Toggle the magnet on or off
[/left]

Play with the magnet manually by using the arrow keys to move and enter to toggle.`)),
  (mentor_centered, (31337_81427576809439, `This level is difficult, but it is a good opportunity for you to use functions. In fact the following solution to the level contains a "recursive function", which means a function that calls itself.

[b]Tower of Hanoi algorithm:[/b]
[box][left]func move(disk_nr, source, dest, spare) {
    if disk_nr is 0 {
        move disk from source to dest
    } else {
        move(disk_nr - 1, source, spare, dest)
        move disk from source to dest
        move(disk_nr - 1, spare, dest, source)
    }
}[/left][/box]

[tip]Remember to push register values to the stack to store them in function that changes them.[/tip]`))
]
post_mortem = [
  (mentor_centered, (31337_62636370223849, `Amazing, you finished all our tests! Look how far you have come from the NAND gate. 

Humans are truly worthy of joining the Galactic Federation.`))
]
