Skip to content

Commit

Permalink
Allow stats for files with only 1 puzzle in to be printed
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Pauley committed Mar 24, 2011
1 parent 09c41ef commit 09f3470
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sudoku.py
Expand Up @@ -150,7 +150,7 @@ def time_solve(grid):
return (t, solved(puzzle), puzzle)
times, results, valuedicts = zip(*[time_solve(grid) for grid in grids])
N = len(grids)
if N > 1:
if N >= 1:
print """Solved %d of %d puzzles from %s in %.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))
Expand Down

0 comments on commit 09f3470

Please sign in to comment.