title: Rotating blocks in 2D-array
body: <p>I am making a program similar to the famous game Tetris and I've run into some problems when it comes to rotating a block.</p>
  
  <p>I know you are able to rotate figures in a coordinate system by using "x = -y" and "y = x" but the problem is that because I am using an array of integers to represent the block it makes things so much more difficult.</p>
  
  <p>My array looks like:</p>
  
  <pre><code>int[][] space = new int[20][10];
  </code></pre>
  
  <p>And if a coordinate contains a block the value is 1 else it's 0.</p>
  
  <p>So how can I rotate a block in that space without getting trouble with negative numbers?</p>