# Generate square sub-matrices of 1's [duplicate]

Back again, stealing another question from stackoverflow.

You are given a list of integers >= 0. Generate in order square 1-matrices where the side length is given by the list entry of the current index and fill the rest with 0s.

So given a list 2,4,1,3 print this to stdout:

1 1 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0
0 0 1 1 1 1 0 0 0 0
0 0 1 1 1 1 0 0 0 0
0 0 1 1 1 1 0 0 0 0
0 0 1 1 1 1 0 0 0 0
0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 1 1 1


# Rules

• Efficiency doesn't matter. (as long as it terminates on e.g. TIO)
• Standard loopholes are forbidden.
• In/Output has to adhere to the default I/O consensus.
• This is code-golf. Shortest answer in bytes wins!
• A nice question, but a duplicate. – xnor Oct 23 '19 at 7:08
• Sorry, that one wouldn't pop up when I searched for duplicates. – jaaq Oct 23 '19 at 11:22