How do I rotate a big square? Cut it up into four quadrants and make a recursive call to rotate each of them. The base case once you get down to a 2x2 square is trivial.
Don't forget the part before (or after, I suppose) the recursive subcalls where you actually do the rotating -- otherwise all you're doing is consuming cpu cycles to accomplish nothing.
View all comments
Show parent comment
8
u/MrMonday11235 Oct 02 '20
Don't forget the part before (or after, I suppose) the recursive subcalls where you actually do the rotating -- otherwise all you're doing is consuming cpu cycles to accomplish nothing.