title: Fatal error while printing a 2 dimensional array
body: <p>Im having this problem with a little chunk of code:</p>
  
  <pre><code>for(x = 0; x &lt; 8; x++){
  for(y = 0; y &lt; 8; y++){
  printf(" %d", occupy[x][y]);
  }
  printf(" \n");
  }
  </code></pre>
  
  <p>I'm making a randomly generated maze game for the Gameboy, and I'm using a 2d array to know where each screen is in the maze. For testing I'm trying to print that array so I can see if its generating properly before I move on. When I try to compile with that little chunk of code I get an error on the top line of it, then says fatal Compiler internal error in file blah blah blah. Is there like a big no-no in that code that I didn't know of?</p>
  
  <p>Full code:</p>
  
  <pre><code>#include &lt;gb\gb.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;rand.h&gt;
  
  
  #define UP 0x01U
  #define RIGHT 0x02U
  #define DOWN 0x04U
  #define LEFT 0x08U
  
  int occupy[8][8]= {
  {0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0}
  };
  
  
  void generate(){
  int temp;
  int x;
  int y;
  UBYTE restrict;
  UBYTE direction;
  for(x = 0; x &lt; 8; x++){
  for(y = 0; y &lt; 8; y++){
  occupy[x][y] = 0;
  }
  }
  /* ========Occupy=Cleared========== */
  restrict = 0x00U;
  x = rand() &amp; 7;
  y = rand() &amp; 7;
  
  if(x == 6 || x == 7){ restrict += RIGHT;}
  if(x == 0 || x == 1){ restrict += LEFT;}
  if(y == 0 || y == 1){ restrict += UP;}
  if(y == 6 || y == 7){ restrict += DOWN;}
  
  /* in the rest of generation wrap this block in if(restrict != 0x0FU){ */
  
  do{
  temp = rand() &amp; 3;
  if(temp == 0){ direction = UP;}
  if(temp == 1){ direction = RIGHT;}
  if(temp == 2){ direction = DOWN;}
  if(temp == 3){ direction = LEFT;}
  }while(restrict &amp; direction);
  
  
  occupy[x][y] = 5;
  if(direction == UP){ occupy[x][y-1] = 1;}
  if(direction == RIGHT){ occupy[x+1][y] = 2;}
  if(direction == DOWN){ occupy[x][y+1] = 3;}
  if(direction == LEFT){ occupy[x-1][y] = 4;}
  
  for(x = 0; x &lt; 8; x++){
  for(y = 0; y &lt; 8; y++){
  printf(" %d", occupy[x][y]);
  }
  printf(" \n");
  }
  
  }
  
  
  void main(){
  generate();
  
  }
  </code></pre>