forked from steger/pr3-sose2026
13 lines
934 B
Markdown
13 lines
934 B
Markdown
# Assignment - Tower of Hanoi {.alert}
|
|
|
|
The Tower of Hanoi is a classic mathematical puzzle that involves three rods and a number of disks of different sizes.
|
|
The puzzle starts with all the disks stacked in ascending order of size on one rod (the source rod), with the smallest disk on top.
|
|
The objective is to move the entire stack to another rod (the destination rod), following these rules:
|
|
|
|
1. Only one disk can be moved at a time.
|
|
2. Each move consists of taking the top disk from one rod and placing it on another rod.
|
|
3. No disk may be placed on top of a smaller disk.
|
|
|
|
**Your task:**
|
|
|
|
Implement a function that solves the Tower of Hanoi problem for `n` disks. The rods are represented as Chars (e.g. 'a','b','c'). The result shall be a list of moving instructions. Add your implementation to the file `04-hanoi/hanoi.hs` that already contains a test and a helper function that creates the move instruction for a single move. |