Final Course Project: Sudoku
Final Course Project: Sudoku
Final Course Project: Sudoku
SUDOKU
top2500.txt
If you need more: database with 2500 puzzles
diag200.txt
200 diagonal Sudoku puzzles
Make sure to follow the directions there precisely, and complete the
missing code so that they eventually work
def draw(self):
# Draw Cell object on the canvas
# Graphics should consist of a Rectangle object and a text label
# Label is: 1, 2, 3, ..., 9
# An empty cell (0) has no label
# Key command:
# canvas.create_text(p.x, p.y, text=label, font=self.font, fill=self.color)
# p is the Cell center Point
def Cell_test():
a = Cell(7)
b = Cell(2)
c = Cell(0)
a.place(200,130)
b.place(70,105)
c.place(230,180)
a.draw()
b.draw()
c.draw()
print c.size
show_canvas()
puzzle2 = "005080700 700204005 320000084 060105040 008000500 070803010 450000091 600508007 003010600"
puzzle3 = "4.....8.5.3..........7......2.....6.....5.4......1.......6.3.7.5..2.....1.9......"
s1 = Sudoku(puzzle1)
s2 = Sudoku(puzzle2)
s3 = Sudoku(puzzle3)
s = Sudoku(puzzle4)
s.draw()
Hint: The cells are Rectangle objects
with a label in the middle.
The blue blocks can be 9 Rectangles
or a simple draw_grid() – (8 Lines)
s = Sudoku(puzzle4)