I was looking at a post in the challenge tag today, and it got me looking into polar coordinates, and I saw that you can rotate an array by 180 degrees by putting a pole in the middle and spinning the array around it, so here it is:
The only issue I have is that small arrays seem to get a load of gaps at the beginning that I needed to filter out. Not sure why that is.
Top comments (1)
I see the problem. I'm creating a square grid, and if the array's length is not a perfect square, then there will be blanks in the grid, which get rotated with the items.