Given an integer N from 1-9, you must print an NxN grid of NxN boxes that print alternating 1s and Ns, with each box having an alternating starting integer.
Examples
Input: 1
Output:
1
Input: 2
Output:
12 21
21 12
21 12
12 21
Input: 3
Output:
131 313 131
313 131 313
131 313 131
313 131 313
131 313 131
313 131 313
131 313 131
313 131 313
131 313 131
Input: 4
Output:
1414 4141 1414 4141
4141 1414 4141 1414
1414 4141 1414 4141
4141 1414 4141 1414
4141 1414 4141 1414
1414 4141 1414 4141
4141 1414 4141 1414
1414 4141 1414 4141
1414 4141 1414 4141
4141 1414 4141 1414
1414 4141 1414 4141
4141 1414 4141 1414
4141 1414 4141 1414
1414 4141 1414 4141
4141 1414 4141 1414
1414 4141 1414 4141
An array (of NxN arrays) or text in this format is acceptable.
[[1,2,2,1],[2,1,1,2],[1,2,2,1],[,2,1,1,2]]
an acceptable output for \$N = 2\$? \$\endgroup\$