Skip to content
Browse files

Print number of eliminations

  • Loading branch information...
1 parent 09f3470 commit 721a610c8244a9fa5a1c2e6c48d09d44367bb7dd @apauley committed Mar 24, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 sudoku.py
View
7 sudoku.py
@@ -149,11 +149,14 @@ def time_solve(grid):
print '(%.2f seconds)\n' % t
return (t, solved(puzzle), puzzle)
times, results, valuedicts = zip(*[time_solve(grid) for grid in grids])
+ eliminations = [puzzle.count for puzzle in valuedicts]
+
N = len(grids)
if N >= 1:
- print """Solved %d of %d puzzles from %s in %.6f secs
+ print """Solved %d of %d puzzles from %s in %d eliminations, %.6f secs
\t(avg %.6f secs (%d Hz), max %.6f secs, min %.6f secs).""" % (
- sum(results), N, name, sum(times), sum(times)/N, N/sum(times), max(times), min(times))
+ sum(results), N, name, sum(eliminations), sum(times),
+ sum(times)/N, N/sum(times), max(times), min(times))
return valuedicts
def solved(puzzle):

0 comments on commit 721a610

Please sign in to comment.
Something went wrong with that request. Please try again.