title: C++ Chess table BGI graphics
body: <p>I know it's pretty amateur, but I got a task of drawing a 8x8 chess table with the usual "A B C..." "1 2 3" text on the side. I have to use 2 for loops, but I'm quite stuck, I can only display one row with 8 bars, here's my code:</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cstdio&gt;
  using namespace std;
  #include&lt;graphics.h&gt;
  
  int main()
  {
      int i,j=0;
      int upperline=50;
      int widthline=50;
      double godown=500/8;
      double goright=700/8;
  
      initwindow(800,600,"Chessboard");
      setbkcolor(LIGHTGRAY);
      cleardevice();
      for(i=0;i&lt;8;i++)
          {
              for(j=0;j&lt;8;j++)
              {
                  if(i % 2==0) setfillstyle(SOLID_FILL,BLACK);
                  else setfillstyle(SOLID_FILL,WHITE);
                  bar(widthline,upperline,widthline+goright,upperline+godown);
                  outtextxy(widthline+goright/2-5,upperline/2,"A");
                  outtextxy(widthline+goright/2-5,600-upperline/2,"B");
              }
              widthline=widthline+goright;
          }
      getch();
      closegraph();
  }
  </code></pre>
  
  <p>I'm using CodeBlocks by the way. Any kind of help is welcomed, just keep it simple. :)
  Cheers</p>