Apr-08-2020, 07:55 AM
Thankyou so much Mateusz! That was exactly what I was looking for! From here I can find out which square the requested cell is in, and just return the result of that square.
The code for each square's contents as expanded from Mateusz's code:
The code for each square's contents as expanded from Mateusz's code:
sq1 = [*puzzle[0][:3],*puzzle[1][:3],*puzzle[2][:3]] sq2 = [*puzzle[0][3:6],*puzzle[1][3:6],*puzzle[2][3:6]] sq3 = [*puzzle[0][6:9],*puzzle[1][6:9],*puzzle[2][6:9]] sq4 = [*puzzle[3][:3],*puzzle[4][:3],*puzzle[5][:3]] sq5 = [*puzzle[3][3:6],*puzzle[4][3:6],*puzzle[5][3:6]] sq6 = [*puzzle[3][6:9],*puzzle[4][6:9],*puzzle[5][6:9]] sq7 = [*puzzle[6][:3],*puzzle[7][:3],*puzzle[8][:3]] sq8 = [*puzzle[6][3:6],*puzzle[7][3:6],*puzzle[8][3:6]] sq9 = [*puzzle[6][6:9],*puzzle[7][6:9],*puzzle[8][6:9]]Just find out which square it's in, and problem solved!