If I have a function which randomly returns 2D lists of the same size, how would I "tile" them together?
For example, if I generate 4 2D lists which are 3 by 3 in size, how would I combine them in a 2 by 2 arrangement into a 6 by 6 2D list?
[[0,0,0], [[1,1,1], [[2,2,2], [[3,3,3],
[0,0,0], + [1,1,1], + [2,2,2], + [3,3,3],
[0,0,0]] [1,1,1]] [2,2,2]] [3,3,3]]
Arranged h=2 by w=2 makes:
[[0,0,0,1,1,1],
[0,0,0,1,1,1],
[0,0,0,1,1,1],
[2,2,2,3,3,3],
[2,2,2,3,3,3],
[2,2,2,3,3,3]]
In my case the individual lists are generated randomly and returned by a function which takes width and height as arguments.
I need to specify some dimensions (h and w) and arrange (h*w) random sub-grids into an h by w super-grid. The order/specific arrangement of the sub-grids doesn't matter, one after the other or any other arrangement is fine.
How would I go about doing this if I want a function that takes as arguments width and height of the super-grid, and width and height of the sub-grids?