Diff of /Test/examples/towers_of_hanoi.tst [000000] .. [4dca5a]  Maximize  Restore

  Switch to side-by-side view

--- a
+++ b/Test/examples/towers_of_hanoi.tst
@@ -0,0 +1,32 @@
+# towers_of_hanoi.tst
+
+    >>> import sys
+    >>> import pyke
+    >>> import os
+    >>> new_path = os.path.join(os.path.dirname(os.path.dirname(pyke.__file__)),
+    ...                         'examples/towers_of_hanoi')
+    >>> sys.path.append(new_path)
+
+    >>> import run
+
+    >>> run.test(1)
+    got 1: ((0, 2),)
+
+    >>> run.test(2)
+    got 1: ((0, 1), (0, 2), (1, 2))
+    got 2: ((0, 2), (0, 1), (2, 0), (1, 2), (0, 2))
+
+    >>> run.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