[pypy-svn] r24027 - pypy/dist/pypy/lib/logic/computation_space

ale at codespeak.net ale at codespeak.net
Mon Mar 6 17:31:15 CET 2006


Author: ale
Date: Mon Mar  6 17:31:14 2006
New Revision: 24027

Added:
   pypy/dist/pypy/lib/logic/computation_space/parsesudoku.py
   pypy/dist/pypy/lib/logic/computation_space/puzzle1.su
   pypy/dist/pypy/lib/logic/computation_space/solution.su
Log:
(George Paci, ale) I forgot these a sudoku puzle and a solution and a parser for the puzzles

Added: pypy/dist/pypy/lib/logic/computation_space/parsesudoku.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/lib/logic/computation_space/parsesudoku.py	Mon Mar  6 17:31:14 2006
@@ -0,0 +1,11 @@
+import sys
+
+file = open(sys.argv[1])
+c = []
+row = 1
+for line in file.readlines():
+    for col in range(1,10):
+        if line[col-1] != ' ':
+            c.append(('v%d%d' % (col, row), int(line[col-1])))
+print c
+    

Added: pypy/dist/pypy/lib/logic/computation_space/puzzle1.su
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/lib/logic/computation_space/puzzle1.su	Mon Mar  6 17:31:14 2006
@@ -0,0 +1,9 @@
+ 74   65 
+5  6 7  3
+3 9   2 1
+ 2 413 8 
+   8 5   
+ 5 276 1 
+4 7   1 2
+6  7 1  5
+ 15   49 

Added: pypy/dist/pypy/lib/logic/computation_space/solution.su
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/lib/logic/computation_space/solution.su	Mon Mar  6 17:31:14 2006
@@ -0,0 +1,9 @@
+274139658
+581627943
+369584271
+726413589 
+143895726   
+958276314 
+437958162
+692741835
+815362497



More information about the Pypy-commit mailing list