Hello everyone, I've been told that the reason for these crashes is how much data is being processed. Here is my code:
import random
class game(object):
def __init__(self):
self.found = False
self.board = list([[0] for i in range(9)] for i in range(9))
for column in range(0,9):
for row in range(0,9):
run = True
while run:
x = random.randint(1,9)
n = column
o = x
p = row
self.found = False
if x not in self.board[column]:
for y in range(9):
self.check = True
if y != column:
if self.board[y][row] == x:
self.check = False
else:
self.check = False
if self.check == True:
self.board[column][row] = x
run = False
print(self.board)
game()
What do you think? How can I fix this to make a working sudoku generator. If you also know how to make the 3 by 3 squares, that would help out too. Thank you.