# Untitled

unknown
plain_text
3 years ago
1.9 kB
1
Indexable
Never
``` # down-right sudoku

if (x>8 and y>11):

#joint square
if (x>11 and x<15 and y<15):
for i in range(6, 21):
if Matrix[y][i] == n:
return False

for i in range(6, 21):
if Matrix[i][x-3] == n:
return False

x0 = (x//3)*3
y0 = (y//3)*3
for i in range(0, 3):
for j in range(0, 3):
#  print(board[y0+i][x0+j])
if Matrix[y0+i][x0+j] == n:
return False
return True
elif x>=15 and y<15:
for i in range(12, 21):
if Matrix[y][i] == n:
return False

for i in range(15, 21):
if Matrix[i][x-3] == n:
return False

x0 = (x//3)*3
y0 = (y//3)*3
for i in range(0, 3):
for j in range(0, 3):
#  print(board[y0+i][x0+j])
if Matrix[y0+i][x0+j] == n:
return False
return True
else:
for i in range(9, 18):
print(Matrix[y][i])
if Matrix[y][i] == n:
return False

for i in range(15, 21):
if Matrix[i][x]   == n:
return False
if Matrix[12][x+3] ==n:
return False
elif Matrix[13][x+3] ==n:
return False
elif Matrix[14][x+3] ==n:
return False
x0 = (x//3)*3
y0 = (y//3)*3
for i in range(0, 3):
for j in range(0, 3):
#  print(board[y0+i][x0+j])
if Matrix[y0+i][x0+j] == n:
return False
return True ```