I’m currently working on a Tetris AI, and I as looking for a method to flip a 4 by 4 multidimensional array. I’ve looked all over, and the most i could find was rotating, which wouldn’t work in my case.
From
o o o o
o x x o
o x o o
o x o o
to
o x o o
o x o o
o x x o
o o o o
I don’t know which dimension you need to flip, but this is one of them… Please note that this method destroys the original array! You didn’t make your needs clear.
That said, here’s one solution
Produces: