repl.it
@anonymous/

FlawedFriendlyBetaversion

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
tup = input()[1:-1].split(',')
x = input('Enter mapping to generate valid Sudoku eg. 3 for 9 x 9')
e = input('Enter 9 for 9 x 9 ...12 for 12 x 12')
f = input('Enter 3 if its a 9 x 9 and corresponding for n^2 x n^2')
x = int(x)
e = int(e)
f = int(f)
squares = []
for index in range(len(tup)):
      tup.append(tup.pop(0))
      squares.append(tup.copy())
    
    #Everything below here is just printing
for s in range(x):
      for d in range(0,e,f):
        for si in range(s,e,f):
          for li in range(d,d+f):
            print(squares[si][li], end = '')
        print('')