- #1
static
- 3
- 0
My task is to draw a square on black background using ppm.
What I did is this loop:
but instead of getting a square I get sth like this:
http://www.polew.pl/file/wastage/test.gif
Why?
What I did is this loop:
Code:
for (int h=0; h<=480; h++){
for (int w=0; w<=640; w++){
if (h>100 && h<380 && w<460){
//green paint
fprintf (fp, "%s", greenColor);
fprintf (fp, "%s", space);
} else {
//paint in black
fprintf (fp, "%s", blackColor);
fprintf (fp, "%s", space);
fprintf (fp, "%s", "\n");
}
}
}
but instead of getting a square I get sth like this:
http://www.polew.pl/file/wastage/test.gif
Why?
Last edited by a moderator: