View Single Post
Old 03-24-2005, 03:31 PM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,720
redhead is on a distinguished road
Some pseudocode:
Code:
Read valueX
Read valueY
Read squareX
Read squareY
while(valueY--)
   While(valueX--)
     print(squares of size squareX)
   print(squares of size squareY)
into code that might look somethig like this: (not tested/compiled/anything)
Code:
while(valueY--)
   {
     /* print vertical line of chessboard */
     while (squareX--)
     {
        /* print horizontal line */
       while(valueX--)
          print('-');
       print('|');
      }
     print('\n');
     squareX = orig_squareX;
     /* print spaces and vertical lines */
     while(squareX--)
     {
         while(valueX--)
           print('-');
         print('|');
      }
     print('\n');
    }
But remember this, I'm drunk right now, so this might be a pointer in the wrong direction....
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001

Last edited by redhead; 03-24-2005 at 03:52 PM.
redhead is offline   Reply With Quote