mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-28 04:00:06 +08:00
72 lines
1.5 KiB
Plaintext
72 lines
1.5 KiB
Plaintext
Solution of Tower of Hanoi Problem with 4 Disks
|
|
|
|
Starting state:
|
|
A: 1 2 3 4
|
|
B: 0 0 0 0
|
|
C: 0 0 0 0
|
|
------------------------------------------
|
|
|
|
|
|
Subsequent states:
|
|
|
|
A: 0 2 3 4
|
|
B: 0 0 0 0
|
|
C: 0 0 0 1
|
|
------------------------------------------
|
|
A: 0 0 3 4
|
|
B: 0 0 0 2
|
|
C: 0 0 0 1
|
|
------------------------------------------
|
|
A: 0 0 3 4
|
|
B: 0 0 1 2
|
|
C: 0 0 0 0
|
|
------------------------------------------
|
|
A: 0 0 0 4
|
|
B: 0 0 1 2
|
|
C: 0 0 0 3
|
|
------------------------------------------
|
|
A: 0 0 1 4
|
|
B: 0 0 0 2
|
|
C: 0 0 0 3
|
|
------------------------------------------
|
|
A: 0 0 1 4
|
|
B: 0 0 0 0
|
|
C: 0 0 2 3
|
|
------------------------------------------
|
|
A: 0 0 0 4
|
|
B: 0 0 0 0
|
|
C: 0 1 2 3
|
|
------------------------------------------
|
|
A: 0 0 0 0
|
|
B: 0 0 0 4
|
|
C: 0 1 2 3
|
|
------------------------------------------
|
|
A: 0 0 0 0
|
|
B: 0 0 1 4
|
|
C: 0 0 2 3
|
|
------------------------------------------
|
|
A: 0 0 0 2
|
|
B: 0 0 1 4
|
|
C: 0 0 0 3
|
|
------------------------------------------
|
|
A: 0 0 1 2
|
|
B: 0 0 0 4
|
|
C: 0 0 0 3
|
|
------------------------------------------
|
|
A: 0 0 1 2
|
|
B: 0 0 3 4
|
|
C: 0 0 0 0
|
|
------------------------------------------
|
|
A: 0 0 0 2
|
|
B: 0 0 3 4
|
|
C: 0 0 0 1
|
|
------------------------------------------
|
|
A: 0 0 0 0
|
|
B: 0 2 3 4
|
|
C: 0 0 0 1
|
|
------------------------------------------
|
|
A: 0 0 0 0
|
|
B: 1 2 3 4
|
|
C: 0 0 0 0
|
|
------------------------------------------
|