User:Nightmareci/SRS

Offsets

 0° 90° 180° 270° (+0, +0) (-1, +0) (+2, +0) (-1, +0) (+2, +0) (-1, +0) (+0, +0) (+0, +0) (+0, +1) (+0, -2) (-1, +1) (+1, +1) (-2, +1) (+1, +0) (-2, +0) (+0, +1) (+0, +1) (+0, +1) (+0, -1) (+0, +2)

 0° 90° 180° 270° (+0, +0) (+0, +0) (+0, +0) (+0, +0) (+0, +0) (+0, +0) (+1, +0) (+1, -1) (+0, +2) (+1, +2) (+0, +0) (+0, +0) (+0, +0) (+0, +0) (+0, +0) (+0, +0) (-1, +0) (-1, -1) (+0, +2) (-1, +2)

0° (+0, +0) (+0, -1) (-1, -1) (-1, +0)

Explanation of Offsets

Upon pressing a rotation input, clockwise or counterclockwise, there is orientation-start (the orientation before the rotation input is sent) and orientation-end (the orientation that will possibly be changed to). True rotation is performed from orientation-start to orientation-end, even if intersection occurs. Next, the first offset pair is attempted; given (a, b) as the first offset for orientation-start and (c, d) as the offset for orientation-end, the number of columns the offset attempt goes rightward is a-c when a-c is positive and leftward if a-c is negative, and the number of rows upward is b-d if b-d is positive and downward if b-d is negative. If applying the first pair of offsets results in some intersection with the field or walls, then the next offset pair is tried, and so on, until an offset pair succeeds; if none succeed, then no change in state will have occurred.