Commits

Shlomi Fish committed ad709f0

Moved print_sol closer to main.

Comments (0)

Files changed (1)

kakurasu-solver/kakurasu-solver.py

 import re
 import sys
 
-def print_sol(sol):
-    for row in sol:
-        for cell in row:
-            sys.stdout.write ('█' if (cell != 0) else '⨯')
-        sys.stdout.write("\n")
-
 class Params:
     pass
 
             [flat_sol[y*width+x] for x in range(width)] 
             for y in range(height)
         ]
+ 
         
+def print_sol(sol):
+    for row in sol:
+        for cell in row:
+            sys.stdout.write ('█' if (cell != 0) else '⨯')
+        sys.stdout.write("\n")
+
 def kakurasu_main(args):
     input_fn = args.pop(1)