title: Tetris : issues when rotate pieces
body: <p>I rotate each piece by rotation formula. More detail, because rotation angle is 90 so :</p>
  
  <pre><code>xNew = y;  
  
  yNew = -x;
  </code></pre>
  
  <p>But my method has met two problems : </p>
  
  <p><strong>1) Out of box :</strong> each type of pieces is fit in square 4x4. (0,0 at under left) But by this rotation, at some case they will out of this box. For example, there is a point with coordinate (5,6) So, please help me how to fit these coordinate into 4x4 box again, or give me another formula for this.</p>
  
  <p><strong>2) at I case :</strong> (4 squares at same row or same column), just has two rotations case. but in method above,  they still has 4 pieces. So, how to prevent this.</p>
  
  <p>Thanks :) </p>