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....