Exemplo n.º 1
0
void malla()
{
    MALLA malla;
    int corX,corY,color,tamX,tamY,x1,y1,x2,y2;
    x2 = y2 = 0;
    char name[20];
    
    x1 = 175;
    y1 = 25;
    x2 = 278;
    y2 = 52;
    
    inicializaMalla( &malla );
    
    do
    {
       dibujaMenu();
       
       corX = mousex();
       corY = mousey();
       
      
       if( corX > x1 && corX < x2 && corY > y1 && corY < y2 ){  //nuevo          
             dibujaLinea( x1 , y2 + 4, x2 , y2 + 4 , YELLOW );
             
             if( ismouseclick( WM_LBUTTONDOWN )){
                    eliminaMalla( &malla );
                    leerDimensiones( &malla );
                    creaMalla( &malla );
             }
       }else{
               dibujaLinea( x1 ,  y2 + 4, x2 , y2 + 4 , BLACK);
               
               if( corX > x2 + 15 && corX < x2 + 95  && corY > y1 && corY < y2  ){  //Abrir
                     dibujaLinea( x2+15,y2+4, x2 + 130 , y2+4, YELLOW );
                       
                         if( ismouseclick(WM_LBUTTONDOWN ) ){
                            imprimeMalla(malla);
                                 
                         }
                   //    printf( " name : %s\n", name );*/        
                }else 
                       dibujaLinea( x2+15, y2+4 , x2 + 130 , y2 + 4, BLACK );         
                        
                  
                }  
             
           clearmouseclick(WM_LBUTTONDOWN );
       
       }while(!kbhit());
}
Exemplo n.º 2
0
int main()
{
      
  initwindow(1000,700);
  top:
  int x(0),y(0);
  
  while (!ismouseclick(WM_LBUTTONDOWN))
        {
            setfillstyle(SOLID_FILL, RED);
            rectangle(0,0,1000,700);
            floodfill(0,0,RED);
            readimagefile("logo.bmp",0,0,80,80);
            settextstyle(9,HORIZ_DIR,6);
            setbkcolor(WHITE);
            setcolor(BLACK);
            outtextxy(400,10,"BILL");
            settextstyle(9,HORIZ_DIR,3);
            outtextxy(20,100,"Particulars");
            outtextxy(300,100,"Qty");
            outtextxy(500,100,"Rate(in Rs.)");
            outtextxy(800,100,"Amount");
            //if qty is >0,print the item name ......etc
            
        }   
}
Exemplo n.º 3
0
void clip_cs_menu() {
    cleardevice();
    outtext((char*)"Click and drag mouse to define rectangular clipping region");

    mouseInput(x1, y1, x2, y2);

    Point2D pMin(std::min(x1,x2), std::min(y1,y2)), pMax(std::max(x1,x2), std::max(y1,y2));
    std::vector<Point2D> rect;
    rect.push_back(pMin); rect.push_back(Point2D(pMin.x, pMax.y));
    rect.push_back(pMax); rect.push_back(Point2D(pMax.x, pMin.y));

    cleardevice();

    mypoly(rect);
    outtext((char*)"Click and drag mouse to make lines to be clipped, right click to EXIT");
    clearmouseclick(WM_RBUTTONDOWN);

    while(!ismouseclick(WM_RBUTTONDOWN)) {
        Point2D p1, p2;
        mouseLine(p1, p2);

        setcolor(RED);
        myline(p1, p2);

        setcolor(WHITE);
        clip_line_cs(pMin, pMax, p1, p2);
    }
}
Exemplo n.º 4
0
bool Pause() {
	char it_is_pause[] = "Пауза";
	const int num_of_item_menu = 5;
	bool flag_exit = false;
	bool flag_is_click = false;
	int number_of_func = -1;
	char* arr_str_menu[num_of_item_menu];
	for (int i = 0; i < num_of_item_menu; i++) {
		arr_str_menu[i] = new char[17];
	}
	strcpy(arr_str_menu[0], "Продолжить");
	strcpy(arr_str_menu[1], "Сохранить игру");
	strcpy(arr_str_menu[2], "Настройки");
	strcpy(arr_str_menu[3], "Правила игры");
	strcpy(arr_str_menu[4], "Выход в меню");
	Menu Pause_Menu(it_is_pause, arr_str_menu);
	for (int i = 0; i < num_of_item_menu; i++)
		delete[] arr_str_menu[i];

	Pause_Menu.draw_background();
	Pause_Menu.set_style_headline(BLACK, 5, 10);
	Pause_Menu.set_coord_start_headline(320, 30);
	Pause_Menu.draw_headline();
	Pause_Menu.set_style_body(GREEN, YELLOW, 4, 10);
	Pause_Menu.set_starting_settings_for_output_of_body(200, 150, 600, 500);
	while (!flag_exit) {
		flag_is_click = false;
		if (ismouseclick(WM_LBUTTONUP)) {
			clearmouseclick(WM_LBUTTONUP);
			flag_is_click = true;
		}
		number_of_func = Pause_Menu.draw_body(mousex(), mousey(), flag_is_click);
		switch (number_of_func)
		{
		case 0:
			/*Продолжить игру*/
			return false;
			//std::cout << " 0 ";
			break;
		case 1:
			/*Сохранить игру*/
			//std::cout << " 1 ";
			break;
		case 2:
			/*Настройки*/
			//std::cout << " 2 ";
			break;
		case 3:
			/*Правила игры*/
			//std::cout << " 3 ";
			break;
		case 4:
			/*Выход в главное меню*/
			return true;
		default:
			break;
		}
	}
}
Exemplo n.º 5
0
void myfunc_menu() {
    cleardevice();
    clearmouseclick(WM_RBUTTONDOWN);
    Point2D a, b;
    outtext((char*)"Click and drag to make a circle and show its radius, RIGHT CLICK TO EXIT");
    do {
        mouseLine(a, b);
        int r = rnd(sqrt(pow((b.x - a.x), 2) + pow((b.y - a.y), 2)));
        myline(a, b);
        mycircle(a, r);
    }while(!ismouseclick(WM_RBUTTONDOWN));
}
Exemplo n.º 6
0
void menu()
{
    int op=-1, xm, ym, i, margin = 70;
    String opciones[] = {"Jugar", "Tienda", "Ayuda", "Créditos"};
    setbkcolor(0x0066F4);
    setfillstyle(1, 0x0066F4);
    setcolor(0x003988);
    settextstyle(2, HORIZ_DIR, 8);

    for(i=0; i<4; i++, margin+=50)
    {
        bar(WIDTH/2-textwidth(opciones[3])/2-5, HEIGHT/2+margin-10, WIDTH/2+textwidth(opciones[3])/2+5, HEIGHT/2+margin+textheight(opciones[3])+10);
        outtextxy(WIDTH/2-textwidth(opciones[i])/2, HEIGHT/2+margin, opciones[i]);
    }

    do
    {
        while(!ismouseclick(WM_LBUTTONDOWN));
        getmouseclick(WM_LBUTTONDOWN, xm, ym);
        margin = 70;
        for(i=0; i<4; i++, margin+=50)
            if(xm>WIDTH/2-textwidth(opciones[3])/2-5
               && xm<WIDTH/2+textwidth(opciones[0])/2-10
               && ym>HEIGHT/2+margin-10
               && ym<HEIGHT/2+margin+textheight(opciones[3])+10)
                {
                    op = i;
                    i=5;
                    break;
                }
    }while(op==-1);

    fflush(stdin);
    switch(op)
    {
        case 0:
            juego(3);
            break;
        case 1:
            tienda();
            break;
        case 2:
            ayuda();
            break;
        case 3:
            creditos();
            break;
    }
}
Exemplo n.º 7
0
void botoes(char tecla){
	if(ismouseclick(WM_LBUTTONDOWN)){
		getmouseclick(WM_LBUTTONDOWN, mouse_dx, mouse_dy);
		
		if (come < CONTROLE_STATS){
			if ((CONTROLE_STATS - come) >= 5){
				come += 5; 
				pontuacao += 100;
			}else{
				come += (CONTROLE_STATS - come);
				pontuacao += (come/3);
			}
		}
	}
}
Exemplo n.º 8
0
void main(void)
{
    int maxx, maxy;  // Maximum x and y pixel coordinates
    int x, y;        // x and y pixel coordinates of a mouse click
    int divisor;     // Divisor for the length of a triangle side
    bool red_clicked;// Changes to true when a red pixel is clicked
    
    // Put the machine into graphics mode and get the maximum coordinates:
    initwindow(450, 300);         
    maxx = getmaxx( );
    maxy = getmaxy( );
    
    // Draw a white circle with red inside and a radius of 50 pixels:
    setfillstyle(SOLID_FILL, RED);
    setcolor(WHITE);
    fillellipse(maxx/2, maxy/2, 50, 50);
    
    // Print a message and wait for a red pixel to be double clicked:
    settextstyle(DEFAULT_FONT, HORIZ_DIR, 2);
    outtextxy(20, 20, "Left click in RED to end.");
    setcolor(BLUE);
    red_clicked = false;
    divisor = 2;
    while (!red_clicked)
    {
        triangle(maxx/divisor, maxy/divisor);
        delay(500);
        divisor++;
	if (ismouseclick(WM_LBUTTONDOWN))
	{
	    getmouseclick(WM_LBUTTONDOWN, x, y);
	    red_clicked = (getpixel(x, y) == RED);
	}
    }

    cout << "The mouse was clicked at: ";
    cout << "x=" << mousex( );
    cout << " y=" << mousey( ) << endl;
    
    // Switch back to text mode:
    closegraph( );
}
Exemplo n.º 9
0
int main()
{   
    initwindow(1275,700);
    setfillstyle(1,1);
    floodfill(100,100,1);
    
    setcolor(12);
    setbkcolor(1);
    settextstyle(0,0,8);
    outtextxy(330,160,"WELCOME TO ");
    outtextxy(140,270,"THE V-PLAY STORE");
    
    setcolor(7);
    rectangle(140,450,440,550);
    rectangle(840,450,1140,550);
    setfillstyle(1,7);
    floodfill(300,500,7);
    setfillstyle(1,7);
    floodfill(950,500,7);
    settextstyle(0,0,4);
    setcolor(0);
    setbkcolor(7);
    outtextxy(170,480,"Sign Up!");
    outtextxy(875,480,"Sign In");
    
    
    int x = getmaxx( );
    int y = getmaxy( );
    setmousequeuestatus(WM_LBUTTONDOWN);
    while(!ismouseclick(WM_LBUTTONDOWN));
    {
                                        getmouseclick(WM_LBUTTONDOWN,x,y);
                                        if((x>840 && x<1140) && (y>450 && y<550))
                                        login();
                                        else if((x>140 && x<440) && (y>450 && y<550))
                                        signup();
    }
    system("pause");
    return 0;
}
Exemplo n.º 10
0
void Guess (int level, int code[])
{
     static int guessNum = 1;
     int i = 0, j;
     int guess[level];
     char selection;
     int x,y;
     
     outtextxy(410,150, "Now, Let\'s make your guess!");     
     
     if (guessNum == 13)
     {
         printf("\n\nYou have made 12 guesses already! You lost!\n\n");
         outtextxy(380,180, "GAME OVER! You have lost the game");
         printf("\nWould you like to play again? (Y/N): ");
         fflush(stdin);
         scanf("%c",&selection);
         fflush(stdin);
         if (selection == 'Y' || selection == 'y')
         {
              guessNum = 1;
              Menu();
         }
         else if (selection == 'N' || selection == 'n')
         {
              printf("\n");
              system("pause");
              exit(1);     
         }
         else
         {
              printf("\aWARNING: you should enter \'Y\' or \'N\'\n");
              Guess(level,code);
         }
     }
     
     printf("\nGuess %d:\n------------\n",guessNum);
     
     while (i != level)
     {
         switch (i)                               // according to i value (which goes to level), automatically running correct printf function..
         {
              case 0:
                   printf("Enter your guess for hat");
                   break;
                   
              case 1:
                   printf("Enter your guess for eyes");
                   break;
                   
              case 2:
                   printf("Enter your guess for nose");
                   break; 
                   
              case 3:
                   printf("Enter your guess for mouth");
                   break;
                   
              case 4:
                   printf("Enter your guess for clothes");
                   break; 
         }
         FillColor(i,11);                                            // changing color of current feature
         
         if (level == 5)                                             // according to level, running correct printf function..
         printf(" (1:red, 2:green, 3:blue, 4:purple, 5:yellow): ");
         else
         printf(" (1:red, 2:green, 3:blue): ");
         
         while (1)                                                  // taking mouse clicks or running scanf function
         {            
                guess[i] = -1;
    // ---------------------------------------------------------------------------------------------------------  
    // NOTICE:  Make "Comment" here, If you want to use Mouse while guessing          
    
    // <== REMOVE HERE              /*         
    
                if ( scanf("%d",&guess[i]) != -1 )
                {
                     if (guess[i] > level)
                     continue;
                     
                     else
                     {
                         clearmouseclick(WM_LBUTTONDOWN);     
                         break;
                     }
                }
                
    //                      */
    // ---------------------------------------------------------------------------------------------------------  
    
                if ( ismouseclick(WM_LBUTTONDOWN) )
                {
                      x = mousex();
                      y = mousey();
                      
                      if ( ( (x >= 380 && x <= 420) && (y >= 80 && y <= 120) )  ||
                           ( (x >= 430 && x <= 470) && (y >= 80 && y <= 120) )  ||
                           ( (x >= 480 && x <= 520) && (y >= 80 && y <= 120) )  ||
                           ( (x >= 530 && x <= 570) && (y >= 80 && y <= 120) && level == 5 )  ||
                           ( (x >= 580 && x <= 620) && (y >= 80 && y <= 120) && level == 5 )  )
                      {
                                                 
                           clearmouseclick(WM_LBUTTONDOWN);      // if user clicks on correct place (buttons), take it..
                           break;
                      }
                      else
                      {
                           clearmouseclick(WM_LBUTTONDOWN);      // if user clicks on anywhere except buttons, wait to be clicked correctly..
                           continue;
                      }
                }
                

         }
      
                                                                   // Assigning guess[] array values according to the coordinates of mouse clicks
         if ( (x >= 380 && x <= 420) && (y >= 80 && y <= 120) )
         guess[i] = 1;
         if ( (x >= 430 && x <= 470) && (y >= 80 && y <= 120) )
         guess[i] = 2;
         if ( (x >= 480 && x <= 520) && (y >= 80 && y <= 120) )
         guess[i] = 3;
         if ( (x >= 530 && x <= 570) && (y >= 80 && y <= 120) )
         guess[i] = 4;
         if ( (x >= 580 && x <= 620) && (y >= 80 && y <= 120) )
         guess[i] = 5;
         
         
         if (guess[i] != -1)                                    
         printf("%d\n",guess[i]);                                  // this runs when Mouse is used.. 
    
         if (guess[i] == 1)                                        // Calling FillColor() function according to the guesses..
         FillColor(i,4);
         if (guess[i] == 2)
         FillColor(i,2);
         if (guess[i] == 3)
         FillColor(i,1);
         if (guess[i] == 4)
         FillColor(i,5);
         if (guess[i] == 5)
         FillColor(i,14);
           
         i++;                                                    // increasing i, which goes to level
     }
     guessNum++;                                                 // increasing guessNum
     
     CodeCheck(level,code,guess,&guessNum);                      // continue through CodeCheck()
}
Exemplo n.º 11
0
int mainb()
{
     initwindow(1000,750);
     int x=0,y=0;
     while (!ismouseclick(WM_LBUTTONDOWN))
        {
            setfillstyle(SOLID_FILL, RED);
            rectangle(0,0,1000,1000);
            floodfill(0,0,RED);
            
            readimagefile("logo.bmp",0,0,100,100);
            readimagefile("french_fries.bmp",700,200,825,325);
            readimagefile("paneer_wrap.bmp",850,275,975,400);
            readimagefile("chicken_mcnuggets.bmp",850,425,975,550);
            readimagefile("potato_wedges.bmp",700,350,825,475);
            readimagefile("veg_pizza_mcpuff.bmp",700,500,825,625);
           
            settextstyle(9,HORIZ_DIR,6);
            outtextxy(400,10,"Add-ons");
            
            settextstyle(9,HORIZ_DIR,4);
            outtextxy(275,70,"(Click on the name to order)");
            
            settextstyle(9,HORIZ_DIR,3);
            outtextxy(445,150,"PRICE (in Rs.)");
            
            setfillstyle(SOLID_FILL, WHITE);
            rectangle(10,200,400,275);
            rectangle(500,200,575,275);
            floodfill(11,201,WHITE);     
            floodfill(501,201,WHITE);
            
            setfillstyle(SOLID_FILL, WHITE);
            rectangle(10,300,400,375);
            floodfill(11,301,WHITE);  
            rectangle(500,300,575,375);
            floodfill(501,301,WHITE);  
            
            setfillstyle(SOLID_FILL, WHITE);
            rectangle(10,400,400,475);
            floodfill(11,401,WHITE);   
            rectangle(500,400,575,475);
            floodfill(501,401,WHITE); 
            
            setfillstyle(SOLID_FILL, WHITE);
            rectangle(10,500,400,575);
            floodfill(11,501,WHITE);    
            rectangle(500,500,575,575);
            floodfill(501,501,WHITE);
            
            setfillstyle(SOLID_FILL, WHITE);
            rectangle(10,600,400,675);
            floodfill(11,601,WHITE);    
            rectangle(500,600,575,675);
            floodfill(501,601,WHITE);
            
            setfillstyle(SOLID_FILL, WHITE);
            rectangle(675,675,950,725);
            floodfill(676,676,WHITE);
            
            setbkcolor(WHITE);
            setcolor(BLACK);
            settextstyle(9,HORIZ_DIR,3);
            outtextxy(50,225,"BigSpicy Paneer Wrap");
            outtextxy(520,225,"50");
            outtextxy(75,325,"Veg Pizza McPuff");
            outtextxy(520,325,"50");
            outtextxy(120,425,"French Fries");
            outtextxy(520,425,"25");
            settextstyle(9,HORIZ_DIR,3);
            outtextxy(40,525,"BigSpicy Chicken Wrap");
            outtextxy(520,525,"65");
            settextstyle(9,HORIZ_DIR,3);
            outtextxy(65,625,"Chicken McNuggets");
            outtextxy(520,625,"55");
            settextstyle(9,HORIZ_DIR,2);
            outtextxy(685,690,"Return to main menu");
        }
                 

        tryagain:
        getmouseclick(WM_LBUTTONDOWN,x,y);
        
        if (x>10 && x<400 && y>200 && y<275);
                //ask for qty
        else if (x>10 && x<400 && y>300 && y<375);
                //ask for qty
        else if (x>10 && x<400 && y>200 && y<475);
                //ask for qty 
        else if (x>10 && x<400 && y>200 && y<575);  
                //ask for qty
        else if (x>10 && x<400 && y>200 && y<675);
                //ask for qty
        else if (x>675 && x<950 && y>675 && y<725)
        {     closegraph();
               mainx();
         }  
        else
            goto tryagain;
        
        return 0;
}
Exemplo n.º 12
0
void download()
{
    closegraph();
    initwindow(1275,700);
    setfillstyle(1,1);
    floodfill(100,100,1);
    
    setcolor(11);
    setbkcolor(1);
    settextstyle(10,0,5);
    outtextxy(30,275,"Downloading");                                     //Download bar start
    setcolor(15);
    moveto(40,325);
    lineto(1230,325);
    arc(40,335,90,270,10);
    moveto(40,345);
    lineto(1230,345);
    arc(1230,335,270,90,10);                                             //Download bar end
    
    settextstyle(10,0,7);
    setbkcolor(1);
    setcolor(1);                                                //Increasing bar
    for(int i=0,j=40;i<100;i++,j=j+12)
    {
            outintxy(1120,250,i);
            outtextxy(1200,250,"%");
            setcolor(15);
            moveto(j,325);
            lineto(j,345);
            setcolor(11);
            setfillstyle(1,11);
            floodfill(j-2,335,15);
            delay(200);
    }
    delay(3000);
    outtextxy(1100,250,"100%");
    floodfill(1231,335,15);
    
    setcolor(0);                                                  //Done button
    rectangle(1075,580,1205,650);
    setfillstyle(1,7);
    floodfill(1100,600,0);
    setbkcolor(7);
    settextstyle(0,0,3);
    outtextxy(1090,605,"Done");
    
    int x=0,y=0;
    x = getmaxx( );
    y = getmaxy( );
      
      
    setmousequeuestatus(WM_LBUTTONDOWN);
    while(!ismouseclick(WM_LBUTTONDOWN));
    {
               getmouseclick(WM_LBUTTONDOWN,x,y);
    }
        
    if(( x > 1075 && x < 1205 ) && ( y > 580 && y < 650 ))
    {
         thank();
    }
    system("pause");
}
Exemplo n.º 13
0
void Menu::processEvents(){
    
    if ( ismouseclick(WM_LBUTTONDOWN) ) {
        int mouseX, mouseY;
        
        getmouseclick(WM_LBUTTONDOWN, mouseX, mouseY);
        
        if ( startBtn.isClick(mouseX, mouseY) ) {
            status = 1;
            exit = true;
        }
        if ( exitBtn.isClick(mouseX, mouseY) ) {

            status = 2;
            exit = true;
        }
    }
    
    
    
    if(kbhit())
    {
        char key = getch();

        if(key == '\r')
        {
            if(buttonIndex)
            {
                status = 2;
                exit = true;
            }
            else
            {
                status = 1;
                exit = true;
            }
        }
        
        if(key == 27)
        {
            exit = true;
            status = 2;
        }
        
        if(key == NULL)
        {
            char keychar = getch();
            switch(keychar)
            {
                case 'M': //arrow right
                {
                    if(buttonIndex == 1)
                        buttonIndex--;
                    else if(buttonIndex == 0)
                        buttonIndex++;    
                }
                    break;
                
                case 'K': //arrow left
                {
                    if(buttonIndex == 0)
                        buttonIndex = 1;
                    else
                        buttonIndex--;  
                }
                    break;
            }
            
            if(buttonIndex == 1)
            {
                exitBtn.setFocus(true);
                startBtn.setFocus(false);
            }
            else
            {
                exitBtn.setFocus(false);
                startBtn.setFocus(true);
            }
        }
    }    
}
Exemplo n.º 14
0
main()
{
    initwindow(300,370);
    int remark,i,j,k,dp;
    float num[100]={0},number[100]= {0},ans;
    char task;
    task='\0';
    i=0;
    j=0;
    ans=0;
    dp=-1;
    layout();
    setviewport(3,8,290,50,1);
getclick:
    clearmouseclick(513);
    setbkcolor(WHITE);
    clearviewport();
    setcolor(RED);
    settextstyle(2,1,10);
    char c[100];
    if((number[j]==0||number[j]==1)&&j!=0&&i!=1)
    {
        k=j-1;
    }
    else
    {
        k=j;
    }
    if(number[k]-(int)number[k]==0)
    {
        sprintf(c,"%.0f",number[k]);
    }
    else
    {
        sprintf(c,"%.4f",number[k]);
    }
    outtextxy(280,45,c);
    if(task!='S'&&task!='^')
    {
        settextstyle(2,1,6);
        sprintf(c,"%c",task);
        outtextxy(10,25,c);
    }
    delay(500);
    if(ismouseclick(513)==1)
    {
getclick1:
        remark=click();
        if(remark==-1000)
        {
            number[j]=numgen(num,i,dp);
            goto getclick;
        }
        else if(remark==-100)
        {
            return 0;
        }
        else if(remark>=0&&remark<=9)
        {
            if(task=='S')
            {
                j++;
                i=0;
                task='\0';
            }
            num[i]=remark;
            i++;
            number[j]=numgen(num,i,dp);
            clearviewport();
            delay(25);
            goto getclick;
        }
        else if(remark==-1)
        {
            if(i==dp)
            {
                dp=-1;
            }
            i--;
            if(i<0)
            {
                i=0;
            }
            number[j]=numgen(num,i,dp);
            clearviewport();
            delay(25);
            goto getclick;
        }
        else if(remark==-2)
        {
            dp=i;
            //number[j]=numgen(num,i,dp);
            clearviewport();
            delay(25);
            goto getclick;
        }
        //calculate =
        else if(remark==12)
        {
            if(num[0]-(int)num[0]==0)
            {
                number[j]=numgen(num,i,dp);
            }
            else
            {
                number[j]=num[0];
            }
            if(task=='+')
            {
                number[j]=add(number[j-1],number[j]);
            }
            else if(task=='-')
            {
                number[j]=sub(number[j-1],number[j]);
            }
            else if(task=='x')
            {
                number[j]=mul(number[j-1],number[j]);
            }
            else if(task=='/')
            {
                number[j]=divi(number[j-1],number[j]);
            }
              else if(task=='^')
            {
                number[j]=pow(number[j-1],number[j]);
            }
            clearviewport();
            ans=number[j];
            while(1)
            {
                delay(50);
                setbkcolor(WHITE);
                settextstyle(2,1,10);
                if(task=='/'&&number[j]==-1)
                {
                    settextstyle(2,1,8);
                    outtextxy(285,35,"MATH ERROR");
                }
                else if(number[j]-(int)number[j]==0)
                {
                    sprintf(c,"%.0f",number[j]);
                    outtextxy(280,45,c);
                }
                else
                {
                    sprintf(c,"%.4f",number[j]);
                    outtextxy(285,45,c);
                }
                delay(500);
                if(ismouseclick(513))
                {
                    i=0;
                    j=0;
                    number[j]=0;
                    dp=-1;
                    task='\0';
                    clearviewport();
                    delay(50);
                    goto getclick1;

                }
            }
        }
        else if(remark==11)
        {
            if(num[0]-(int)num[0]==0)
            {
                number[j]=numgen(num,i,dp);
            }
            else
            {
                number[j]=num[0];
            }
            if(task=='+')
            {
                number[j]=add(number[j-1],number[j]);
            }
            else if(task=='-')
            {
                number[j]=sub(number[j-1],number[j]);
            }
            else if(task=='x')
            {
                number[j]=mul(number[j-1],number[j]);
            }
            else if(task=='/')
            {
                number[j]=divi(number[j-1],number[j]);
            }
              else if(task=='^')
            {
                number[j]=pow(number[j-1],number[j]);
            }
            j++;
            i=0;
            number[j]=0;
            dp=-1;
            task='+';
            clearviewport();
            delay(25);
            goto getclick;
        }
        else if(remark==13)
        {
            i=0;
            j=0;
            number[j]=0;
            task='\0';
            goto getclick;
        }
        else if(remark==14)
        {
            if(num[0]-(int)num[0]==0)
            {
                number[j]=numgen(num,i,dp);
            }
            else
            {
                number[j]=num[0];
            }
            if(task=='+')
            {
                number[j]=add(number[j-1],number[j]);
            }
            else if(task=='-')
            {
                number[j]=sub(number[j-1],number[j]);
            }
            else if(task=='x')
            {
                number[j]=mul(number[j-1],number[j]);
            }
            else if(task=='/')
            {
                number[j]=divi(number[j-1],number[j]);
            }
              else if(task=='^')
            {
                number[j]=pow(number[j-1],number[j]);
            }
            j++;
            i=0;
            number[j]=0;
            dp=-1;
            task='-';
            clearviewport();
            delay(25);
            goto getclick;
        }
        else if(remark==15)
        {
            if(num[0]-(int)num[0]==0)
            {
                number[j]=numgen(num,i,dp);
            }
            else
            {
                number[j]=num[0];
            }
            if(task=='+')
            {
                number[j]=add(number[j-1],number[j]);
            }
            else if(task=='-')
            {
                number[j]=sub(number[j-1],number[j]);
            }
            else if(task=='x')
            {
                number[j]=mul(number[j-1],number[j]);
            }
            else if(task=='/')
            {
                number[j]=divi(number[j-1],number[j]);
            }
              else if(task=='^')
            {
                number[j]=pow(number[j-1],number[j]);
            }
            j++;
            i=0;
            number[j]=0;
            dp=-1;
            num[i]=0;
            task='x';
            clearviewport();
            delay(25);
            goto getclick;
        }
        else if(remark==16)
        {
            if(num[0]-(int)num[0]==0)
            {
                number[j]=numgen(num,i,dp);
            }
            else
            {
                number[j]=num[0];
            }
            if(task=='+')
            {
                number[j]=add(number[j-1],number[j]);
            }
            else if(task=='-')
            {
                number[j]=sub(number[j-1],number[j]);
            }
            else if(task=='x')
            {
                number[j]=mul(number[j-1],number[j]);
            }
            else if(task=='/')
            {
                number[j]=divi(number[j-1],number[j]);
            }
            else if(task=='^')
            {
                number[j]=pow(number[j-1],number[j]);
            }
            j++;
            i=0;
            number[j]=0;
            dp=-1;
            num[i]=0;
            task='/';
            clearviewport();
            delay(25);
            goto getclick;
        }
        else if(remark==-3)
        {
            number[j]=sqrt(number[j]);
            num[0]=number[j];
            i=1;
            task='S';
            ans=number[j];
            clearviewport();
            delay(50);
            clearmouseclick(513);
            goto getclick;
        }
        else if(remark==-4)
        {
            number[j]=(number[j]/100)*number[j-1];
            if(number[j-1]==0)
            {
                number[j]=0;
            }
            num[0]=number[j];
            i=1;
            task='S';
            ans=number[j];
            clearviewport();
            delay(50);
            clearmouseclick(513);
            goto getclick;
        }
        else if(remark==-5)
        {
            if(num[0]-(int)num[0]==0)
            {
                number[j]=numgen(num,i,dp);
            }
            else
            {
                number[j]=num[0];
            }
            if(task=='+')
            {
                number[j]=add(number[j-1],number[j]);
            }
            else if(task=='-')
            {
                number[j]=sub(number[j-1],number[j]);
            }
            else if(task=='x')
            {
                number[j]=mul(number[j-1],number[j]);
            }
            else if(task=='/')
            {
                number[j]=divi(number[j-1],number[j]);
            }
              else if(task=='^')
            {
                number[j]=pow(number[j-1],number[j]);
            }
            j++;
            i=0;
            number[j]=0;
            dp=-1;
            num[i]=0;
            task='^';
            clearviewport();
            delay(25);
            goto getclick;
        }
        else if(remark==-6)
        {
            number[j]=ans;
            num[0]=ans;
            i=1;
            clearviewport();
            delay(25);
            goto getclick;
        }
        else
        {
            clearmouseclick(513);
            goto getclick;
        }
    }
    clearmouseclick(513);
    goto getclick;
}