Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <winbgim.h>
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
bool blue_clicked = false;
void click_handler(int x, int y)
{
if (getpixel(x,y) == BLUE)
blue_clicked = true;
}
void main()
{
srand(time(NULL));
short x=1;
initwindow(600,400);
registermousehandler(WM_LBUTTONDOWN, click_handler);
blue_clicked = false;
setcolor(BLUE);
setfillstyle(SOLID_FILL, BLUE);
fillellipse(getmaxx()/2, 25, 25, 25);
while (!blue_clicked)
{
setcolor(x);
line(0,0,getmaxx(),getmaxy());
line(getmaxx(),0,0,getmaxy());
setfillstyle(SOLID_FILL, COLOR(rand()%250,rand()%250,rand()%250));
fillellipse(getmaxx()/2, getmaxy()/2, 100, 100);
x++;
if (x==16)
x=1;
delay(250);
}
closegraph();
}