title: Drawing Square field for snake using source code
body: <p>I'm trying to make a square field using this code. but somehow it ended up wrong. could anyone help me point out my mistakes? I'm not sure what I'm doing wrong as it my first time learning C. Here is the code</p>
  
  <pre><code>int i,j;
  
  const int width = 30;
  
  const int height = 30;
  
  int main()
  {  
    for(int i = 0; i &lt; width + 2; i++){
        printf("#");
    }
  
    for(int i = 0;i &lt; height; i++){    
      for(int j = 0; j &lt; width; j++){
        if(j == 0){  printf("#")  }
        if(j == 0){  printf(" ");  }
        if(j == width - 1){  printf("#");  }
      }
    }
  
    for(int i = 0; i &lt; width + 2; i++){
      printf("#"); 
    }
  
  
    return 0;
  }
  </code></pre>