hi everybody
this is my code below that i did so far for my assignment
i made a smiley but ,it s everywhere in my code ,and it s not so perfect i think
i need only 1 and big smiley in my pattern
i think i am missing something in my for loop
Anybody help, i will preciate
Thank you ..
#include "graphics.h"
#include <math.h>
int main()
{
int pattern[16][16] = { { 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,},
{ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,},
{ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,},
{ 15,15,15,0,0,0,15,15,15,15,0,0,0,15,15,15,},
{ 15,15,15,0,0,0,15,15,15,15,0,0,0,15,15,15,},
{ 15,15,15,0,0,0,15,15,15,15,0,0,0,15,15,15,},
{ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,},
{ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,},
{ 15,15,15,15,0,15,15,15, 0,15,15,15,15,15,15,15,},
{ 15,15,15,15,0,0,15,15,0,0,15,15,15,15,15,15,},
{ 15,15,15,15,0,0,0,0,0,0,0,15,15,15,15,15,},
{ 15,15,15,15,0,0,0,0,0,0,0,15,15,15,15,15,},
{ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,},
{ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,},
{ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,},
{ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,},
};
int gd, gm;
gd=VGA; gm=VGAHI;
initgraph(&gd, &gm, "");
int row, column;
for ( row = 50; row <= 400; row++ )
for ( column = 50; column <= 400; column++ ){
putpixel ( column, row, pattern[row %16][column %16] );
}
getch();
closegraph();
return 0;
}