Ok so I have been attempting to create a pattern given to us in my programming class and translate a users in put of the height and width of the pattern to the argument. Not sure if I am doing this correct cause when I run the program it opens I input the width and height and then it closes without generating the output of the pattern with the inputed width and height. any help would be much appreciated....
here is what I have at the moment:
#include \"DarkGDK.h\"
const DWORD white = dbRGB(255,250,250);
const DWORD black = dbRGB(0,0,0);
void drawPattern(int &);
void DarkGDK()
{
int x,y;
dbPrint(\"Enter the patterns width:\");
x = atoi(dbInput());
dbPrint(\"Enter the patterns height:\");
y = atoi(dbInput());
}
void drawPattern(int &x, int &y)
{
int upperX,upperY,lowerX,lowerY;
dbClear(255,250,250);
dbInk(black, white);
dbLine(0,0,640,480);
dbLine(640,0,0,480);
dbLine(320,0,320,480);
dbLine(0,240,640,240);
upperX = (320-(x/2));
upperY = (240-(y/2));
lowerX = (320+(x/2));
lowerY = (240+(y/2));
dbInk(black, black);
dbBox(upperX,upperY,lowerX,lowerY);
dbWaitKey();
}