Menu

#13 Can not generate puzzle with code provided from website

open
nobody
None
5
2009-12-16
2009-12-16
Anonymous
No

When I try to execute the code-example from http://pythonsudoku.sourceforge.net/doc/howto.html on my computer as follows:

/usr/games$ pysdk --difficulty=normal --region_width=3 --region_height=3 --handicap=0 sudoku.sdk

I only get the following output:

Traceback (most recent call last):
File "/usr/games/pysdk", line 203, in <module>
main()
File "/usr/games/pysdk", line 197, in main
status = not solve_sudoku(args[0])
File "/usr/lib/pymodules/python2.6/pythonsudoku/text.py", line 109, in solve_sudoku
board = Board(filename=filename)
File "/usr/lib/pymodules/python2.6/pythonsudoku/board.py", line 105, in __init__
self.load(filename)
File "/usr/lib/pymodules/python2.6/pythonsudoku/board.py", line 178, in load
f = file(filename, "rU")
IOError: [Errno 2] No such file or directory: 'sudoku.sdk'
-- Ende --

Ein Fehler ist aufgetreten, bitte gehen Sie zu http://sourceforge.net/tracker/?group_id=150356&atid=778307 und senden Sie einenFehlerreport mit den zuletzt ausgegebenen Zeilen.

I tried to create the file manually (even chmod-ded it to 777) but it still didn't work:

Traceback (most recent call last):
File "/usr/games/pysdk", line 203, in <module>
main()
File "/usr/games/pysdk", line 197, in main
status = not solve_sudoku(args[0])
File "/usr/lib/pymodules/python2.6/pythonsudoku/text.py", line 109, in solve_sudoku
board = Board(filename=filename)
File "/usr/lib/pymodules/python2.6/pythonsudoku/board.py", line 105, in __init__
self.load(filename)
File "/usr/lib/pymodules/python2.6/pythonsudoku/board.py", line 200, in load
max_n = int(max(array) ** (1 / 2.0))
ValueError: max() arg is an empty sequence

What am I missing or doing wrong?

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.