/* Program 1.5 */ /* Pixels */ /* Used header fies */ #include #include #include #include /* Main function - our program */ int main(void) { int loop_counter; int colour; int driver,mode,err=0; int x_pixels; int y_pixels; driver = DETECT; mode = VDIMODE; initgraph(&driver, &mode, ""); err = graphresult(); if(err) { puts(grapherrormsg(err)); return(err); } srand(32000); settextstyle(DEFAULT_FONT,HORIZ_DIR,10); moveto((getmaxx()/2),(getmaxy()/2)); outtext("Got the point ?????"); for (loop_counter=0;loop_counter<=6000;loop_counter++) { x_pixels=(random(getmaxx())); y_pixels=(random(getmaxy())); colour=(random(16)); putpixel(x_pixels,y_pixels,colour); } getch(); /* wait for keyboard event */ closegraph(); return(graphresult()); }