The rules given with this question were simple; you have a 10 by 10 grid in which you can place 4 block-long rectangles horizontally or vertically. Similar to this:

Try it!
So a very simple and straightforward idea is to place every block in every possible direction using pyhton, and this is exactly what the program does.
Using recursion, it is given a grid (empty at first), I then find the next empty block, and try to fill it with a horizontal set of n blocks (n being 4 in this case). It checks that there are 4 blocks of space inside the grid but also for any already used block, because it may be already set by a verticle set previously. If it can’t place a horizontal set of blocks it will test and set a vertical one. When placing a new set of blocks it then calls the function again with the new grid. If neither a horizontal or vertical set can be placed it quits the function. Before placing anything I do a test to check if it’s complete such as to get the possibility.
Well as it seems, a 10 by 10 grid is impossible to fill with 4by1 set of blocks. There is a simple way of looking at why, this explains the method.
A few things that I can do is change the size of the grid to something possible and get a nice result that way.


To conclude, this was a fun quick recursion problem. I definitely like the end display. A few optimizations could be done, like when calling the function again I parse through the last position occupied to not loop from the start to the next empty block but, really there is no need because it’s just for fun.
Hope you enjoyed. Byeee!