Progress: Rotational Frustration Resolved

Hell of a frustrator today. Went to the lab to collect the rotation print outs to find out how the rotation behaves. After much humming and harring, I resolved to create a paper Tetris model.
Once I had cut out the little pieces, I placed them at their coordinates as given by the tests and spun them at their centre with a toothpick. This greatly helped in finding the better rotation method. I was able to figure that the Tetrominos rotate about the centre of a central-ish unit. The problem I had before regarding symmetrical pieces rotating the same regardless of the rotation direction stopped me from realising this before. Now I realise that symmetrical piece rotation cannot be greater than 180 degrees. It is simply modulo’ed when it reaches 180 and reverts to it’s 0 degree form. Everything has been solved here now!

Not much left to do now that the framework is set in place…
9/13 tests passing.

Leave a Reply

Your email address will not be published. Required fields are marked *