Skip to content

Commit

Permalink
Merge pull request #734 from akumm2k/master
Browse files Browse the repository at this point in the history
Make sudoku.py Python3 compatible
  • Loading branch information
mikand committed Oct 28, 2022
2 parents ffb362d + 0973005 commit 712b9cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Expand Up @@ -36,3 +36,4 @@ Vijay Raghavan <vijaysgr8@gmail.com>
Wael-Amine Boutglay <btwael@gmail.com>
Yoni Zohar <yoni206@gmail.com>
Yuri Malheiros <yurimalheiros@gmail.com>
Aryan Kumar <akumm2k@gmail.com>
10 changes: 5 additions & 5 deletions examples/sudoku/sudoku.py
Expand Up @@ -156,7 +156,7 @@ def main():
help='The sudoku base size', default=3)

parser.add_argument('--solver', '-s', metavar='name', type=str,
choices=['auto'] + env.factory.all_solvers().keys(),
choices=['auto'] + list(env.factory.all_solvers().keys()),
default='auto',
help='The solver to use (default: auto)')

Expand All @@ -182,14 +182,14 @@ def main():
constraints = read_constraints(args.problem)
res = sudoku.solve(constraints)
if res is None:
print "No solution exists"
print("No solution exists")
else:
for row in res:
print "\t".join(str(x) for x in row)
print("\t".join(str(x) for x in row))
else:
print "No problem specified! Either use the gui.py script or pass" \
print("No problem specified! Either use the gui.py script or pass" \
" a problem with --problem flag. Example problems are available" \
" in the problems/ folder."
" in the problems/ folder.")



Expand Down

0 comments on commit 712b9cc

Please sign in to comment.