[727d4a]: examples / towers_of_hanoi / towers_of_hanoi.tst  Maximize  Restore  History

Download this file

26 lines (20 with data), 1.6 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# towers_of_hanoi.tst
>>> import test
>>> test.test(1)
got 1: ((0, 2),)
>>> test.test(2)
got 1: ((0, 1), (0, 2), (1, 2))
got 2: ((0, 2), (0, 1), (2, 0), (1, 2), (0, 2))
>>> test.test(3)
got 1: ((0, 1), (0, 2), (1, 0), (2, 1), (0, 1), (0, 2), (1, 0), (1, 2), (0, 2))
got 2: ((0, 1), (0, 2), (1, 0), (2, 1), (0, 1), (0, 2), (1, 2), (1, 0), (2, 1), (0, 2), (1, 2))
got 3: ((0, 1), (0, 2), (1, 2), (0, 1), (2, 0), (2, 1), (0, 2), (1, 0), (2, 0), (1, 2), (0, 1), (0, 2), (1, 2))
got 4: ((0, 1), (0, 2), (1, 2), (0, 1), (2, 0), (2, 1), (0, 2), (1, 0), (2, 0), (1, 2), (0, 2), (0, 1), (2, 0), (1, 2), (0, 2))
got 5: ((0, 1), (0, 2), (1, 2), (0, 1), (2, 1), (2, 0), (1, 0), (1, 2), (0, 1), (0, 2), (1, 2))
got 6: ((0, 1), (0, 2), (1, 2), (0, 1), (2, 1), (2, 0), (1, 0), (1, 2), (0, 2), (0, 1), (2, 0), (1, 2), (0, 2))
got 7: ((0, 2), (0, 1), (2, 0), (1, 2), (0, 2), (0, 1), (2, 0), (2, 1), (0, 2), (1, 0), (2, 0), (1, 2), (0, 1), (0, 2), (1, 2))
got 8: ((0, 2), (0, 1), (2, 0), (1, 2), (0, 2), (0, 1), (2, 0), (2, 1), (0, 2), (1, 0), (2, 0), (1, 2), (0, 2), (0, 1), (2, 0), (1, 2), (0, 2))
got 9: ((0, 2), (0, 1), (2, 0), (1, 2), (0, 2), (0, 1), (2, 1), (2, 0), (1, 0), (1, 2), (0, 1), (0, 2), (1, 2))
got 10: ((0, 2), (0, 1), (2, 0), (1, 2), (0, 2), (0, 1), (2, 1), (2, 0), (1, 0), (1, 2), (0, 2), (0, 1), (2, 0), (1, 2), (0, 2))
got 11: ((0, 2), (0, 1), (2, 1), (0, 2), (1, 0), (1, 2), (0, 2))
got 12: ((0, 2), (0, 1), (2, 1), (0, 2), (1, 2), (1, 0), (2, 1), (0, 2), (1, 2))

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks