Created Tower of Hanoi (markdown)
commited
commit
6e41d05c44c67e9970325506d674b6539fe8c915
... | ... | @@ -0,0 +1,28 @@ |
1 | --- |
|
2 | quest: true |
|
3 | --- |
|
4 | [Tower of Hanoi](https://play.fancade.com/5EBB62523C0B03D5) by Spolarium is an adaptation of the math puzzle of the same name. |
|
5 | ||
6 | # Gameplay |
|
7 | The gameplay features disks, and 3 pegs. The goals is to get all blocks to the last peg (chequerboarded for convenience) in a pyramid structure from biggest to smallest. Click a peg to dislodge a disk, and click the next peg where you wish to place the disk. Here are the rules: |
|
8 | * You can only move one disk at a time |
|
9 | * You take either the only disk on a peg, or the top disk of a stack, and move it onto the top of another stack, or onto an empty peg. |
|
10 | * You may not place a disk on top of a smaller disk. |
|
11 | ||
12 | # Solution |
|
13 | The following is an iterative solution. From left to right, we will call the pegs A, B and C.<br> |
|
14 | For any n disks, the minimum amount of moves to make to solve the puzzle is (2^n)-1.<br> |
|
15 | For an even amount of disks, the following is done:<br> |
|
16 | * Make a legal move from A to B in any direction. |
|
17 | * Make a legal move from A to C in any direction. |
|
18 | * Make a legal move from B to C in any direction. |
|
19 | ||
20 | Repeat this until the puzzle is solved.<br><br> |
|
21 | For an even amount of disks, the following is done:<br> |
|
22 | * Make a legal move from A to C in any direction. |
|
23 | * Make a legal move from A to B in any direction. |
|
24 | * Make a legal move from B to C in any direction. |
|
25 | ||
26 | Repeat this until the puzzle is solved.<br><br> |
|
27 | ||
28 |