I've found a clever and fun thing to do after solving a n2 × n2 sudoku puzzle. I can take a grid as such as this one and hard-code its indices as constraints to output other 4 × 4 latin squares in poly-time
Now, I took each successive row and hardcoded as indices with successive print statements.
0123 3210 1032 2301
print('enter with [1,2,3...] brackets') text = input()[1:-1].split(',') print(text, text, text, text) print(text, text, text, text) print(text, text, text, text) print(text, text, text, text)
Being a novice at python I'm asking is there a better way of hardcoding the Sudoku's pattern with fewer lines of code?
Because it would be daunting to have to write larger constraints for larger latin squares.
I would appreciate it to keep it O(n) time because I have a desire to input integers besides just elements 1-4. But, 100-104 and so on..