This isn't art, though. Art isn't functional, art creates thought and emotion. Art has thought and emotion behind it. Code can make art, but there has to be a genuine artistic intent behind the code.
At best, this is design, but in reality this is a code snippet that generates random boxes.
No, hard work at aesthetics, vision, and talent did...
There is no clear definition of who is an artist and who is not. It is also something that depends on the context and can even change over time. You are not born an artist, but some people, usually over time, are recognized as artist. Take for example Van Gogh. He did not go to art school and during his life time he was not recognized as an artist. He was too much ahead of his time. It was only after his death that the genius of his paintings was recognized. But would you call a program that imitates his style (using neural networks) generating art? Probably not, because it is just imitation. There is nothing new or insightful about it. It does not impact our thinking in any way.