コード例 #1
0
ファイル: CPROJECT.C プロジェクト: ayushjain515/Stock-Tracker
//*screen 1*//
void screen1()
 {
 int gd=DETECT,gm;
 initgraph(&gd,&gm,PATH);
 setfillstyle(SOLID_FILL,RED);
 bar(0,0,640,480);
 setfillstyle(SOLID_FILL,WHITE);
 bar(15,15,625,465);
 setfillstyle(SOLID_FILL,RED);
 //*for filling color*//
 bar(30,30,610,450);
 //*for constructing 2D bar*//
 settextstyle(1,0,8);
 setcolor(WHITE);
 outtextxy(190,35,"JIIT");
 setfillstyle(SOLID_FILL,LIGHTGRAY);
 bar3d(180,140,385,130,20,20);
 //* for costruct a 3D bar*//
 outtextxy(160,150,"MEDICAL");
 bar3d(140,255,440,245,20,20);
 outtextxy(165,270,"STORE");
 bar3d(145,375,440,365,20,20);
 getch();
 closegraph();
 restorecrtmode();
 //*restore the original video mode detected by initgraph*//
 }     //*here screen 1 coplete*//
コード例 #2
0
ファイル: TIC.C プロジェクト: simitshah/TicTacToe
void reset()
{
  cnt1=0;
  cnt1=0;
  setfillstyle(SOLID_FILL,8);
  bar3d(25,230,125,260,5,1);
  settextstyle(DEFAULT_FONT,0,1);
  outtextxy(35,240,p1);

  setfillstyle(SOLID_FILL,8);
  bar3d(50,290,100,320,5,1);
  settextstyle(DEFAULT_FONT,0,2);
  outtextxy(60,300,"0");

  setfillstyle(SOLID_FILL,8);
  bar3d(25,350,125,380,5,1);
  settextstyle(DEFAULT_FONT,0,1);
  outtextxy(35,360,p2);

  setfillstyle(SOLID_FILL,8);
  bar3d(50,410,100,440,5,1);
  settextstyle(DEFAULT_FONT,0,2);
  outtextxy(60,420,"0");

}
コード例 #3
0
void deleteq(int *front)
{
int l=320,i,l2;
int m=170;
l2=l+40;
s[1]=4;
setcolor(LIGHTGREEN);
setfillstyle(SOLID_FILL,BLACK);
if(*front==0)
{
bar3d(l,m,l2,m+40,1,0);
rectangle(l,m,l+40,m+40);
}
if(*front==1)
{
bar3d(l+40,m,l2+40,m+40,1,0);
rectangle(l,m,l+40,m+40);
}
if(*front==2)
{
bar3d(l+80,m,l2+80,m+40,1,0);
rectangle(l,m,l+40,m+40);
}
if(*front==3)
{
bar3d(l+120,m,l2+120,m+40,1,0);
rectangle(l,m,l+40,m+40);
}
if(*front==4)
{
bar3d(l+160,m,l2+160,m+40,1,0);
rectangle(l,m,l+40,m+40);
}
}
コード例 #4
0
ファイル: buttons.cpp プロジェクト: bdumitriu/playground
void Colors::draw()
{
	setcolor(LIGHTGRAY);
	setfillstyle(SOLID_FILL, fgColor);
	bar3d(x, y, x+15, y+10, 0, 0);
	setfillstyle(SOLID_FILL, bgColor);
	bar3d(x+15, y, x+30, y+10, 0, 0);
}
コード例 #5
0
ファイル: Bankinterface.cpp プロジェクト: pg20/Banking_system
void info::menu()
{     setfillstyle(1,15);
      bar3d(150,8,632,455,4,1);
      setbkcolor(15);


     for(int j=0;j<8;j++)
	 box(j,j,630+j,470+j);
     setfillstyle(1,3);
     bar3d(0,0,150,650,10,1);//to display side strip
     setcolor(1);
     settextstyle(4,0,4);
     outtextxy(50,20,"O");
     outtextxy(50,50,"R");
     outtextxy(50,80,"I");
     outtextxy(50,120,"E");
     outtextxy(50,150,"N");
     outtextxy(50,180,"T");
     outtextxy(50,210,"A");
     outtextxy(50,240,"L");
     outtextxy(50,280,"B");
     outtextxy(50,310,"A");
     outtextxy(50,340,"N");
     outtextxy(50,380,"K");


      settextstyle(1,HORIZ_DIR,1);
     setcolor(0);
     setfillstyle(1,2);
     bar3d(300,100,500,150,4,1);
     setcolor(0);
     outtextxy(320,110,"  Access account");
      //outtextxy(320,110,"  Access account");


     setfillstyle(1,3);
     bar3d(300,180,500,230,4,1);
      bar3d(300,265,500,310,4,1);
     setcolor(6);
     outtextxy(303,190," Create new account");
       outtextxy(303,190," Create new account");
       outtextxy(380,275,"Exit");
     //setcolor(6);
	  outtextxy(380,275,"Exit");


    // setfillstyle(1,3);

     task(choice());
 }
コード例 #6
0
// 画方块
void DrawBlock(BLOCKINFO _block, DRAW _draw)
{
 WORD b = g_Blocks[_block.id].dir[_block.dir];
 int x, y; int color = BLACK;
 switch(_draw)
 {
  case SHOW: color = g_Blocks[_block.id].color; break;
  case HIDE: color = BLACK; break;
  case FIX: color = g_Blocks[_block.id].color / 3; break;
 }
 setfillstyle(color); for(int i=0; i<16; i++)
 {
  if (b & 0x8000)
  {
   x = _block.x + i % 4;
   y = _block.y - i / 4;
   if (y < HEIGHT)
   {
    if (_draw != HIDE)
     bar3d(x * SIZE + 2, (HEIGHT - y - 1) * SIZE + 2, (x + 1) * SIZE - 4, (HEIGHT - y) * SIZE - 4, 3, true);
    else
     bar(x * SIZE, (HEIGHT - y - 1) * SIZE, (x + 1) * SIZE - 1, (HEIGHT - y) * SIZE - 1);
   }
  }
  b <<= 1;
 }
}
コード例 #7
0
ファイル: main.cpp プロジェクト: 20anya02/osminozhka
void cell(int i,int j, int k){
	char s[4];
	bar3d( i*100+300, j*100+100, 90+i*100+300, 90+j*100+100, 10, 0);
	itoa(k,s,10);
	setcolor(YELLOW);
	outtextxy(325+i*100,125+j*100,s);

}
コード例 #8
0
void main()
{
    int gd,gm,x,y,z,o,x1,x2,y1,y2;
    detectgraph(&gd,&gm);
    initgraph(&gd,&gm,"e:\tc\bgi");

    setfillstyle(0,getmaxcolor());
    maxx=getmaxx();
    maxy=getmaxy();
    midx=maxx/2;
    midy=maxy/2;

    axis();

    bar3d(midx+50,midy-100,midx+60,midy-90,5,1);

    printf("Enter translation factor");
    scanf("%d%d",&x,&y);
    axis();
    printf("\nAfter translation: ");
    bar3d(midx+x+50,midy-(y+100),midx+x+60,midy-(y+90),5,1);

    axis();
    bar3d(midx+50,midy-100,midx+60,midy-90,5,1);
    printf("\nEnter scaling factors: " );
    scanf("%d%d%d", &x,&y,&z);

    axis();
    printf("After scaling: ");
    bar3d(midx+(x*50),midy-(y*100),midx+(x*60),midy-(y*90),5*z,1);
    axis();


    bar3d(midx+50,midy-100,midx+60,midy-90,5,1);

    printf("\nEnter rotating angle: " );
    scanf("%d",&o);
    x1=50*cos(o*3.14/180)-100*sin(o*3.14/180);
    y1=50*sin(o*3.14/180)+100*cos(o*3.14/180);
    x2=60*cos(o*3.14/180)-90*sin(o*3.14/180);
    y2=60*sin(o*3.14/180)+90*cos(o*3.14/180);

    axis();
    printf("After rotation about z axis");
    bar3d(midx+x1,midy-y1,midx+x2,midy-y2,5,1);
    axis();

    printf("\nAfter rotation  about x axis: ");
    bar3d(midx+50,midy-x1,midx+60,midy-x2,5,1);

    axis();
    printf("\nAfter rotation about yaxis: ");
    bar3d(midx+x1,midy-100,midx+x2,midy-90,5,1);
    getch();
    closegraph();
}
コード例 #9
0
ファイル: main.cpp プロジェクト: leafspace/Perpetual-Calendar
void drawchoose(void)
{
	char str[50]={0};
	setcolor(RGB(140,140,140));
	setfillcolor(RGB(140,140,140));
	bar3d(130,100,510,140,5,1);
	setcolor(RGB(175,230,65));
	sprintf(str,"YOU CHOOSE DAY IS : %04d年%02d月%02d日",CO_day.year,CO_day.month,CO_day.day);
	setfont(20,10,"");
	outtextxy(150,110,str);
}
コード例 #10
0
ファイル: Com_menu.c プロジェクト: samdubey/COM-PORT-UTILITY
	void Draw(int Active)
	{
		setfillstyle(0,0);
		if(Active)
		{
			setcolor(15);
		}
		else
		{
			setcolor(8);
		}
		bar3d(MLeft,MTop,MLeft+MWidth,MTop+20,0,0);
		outtextxy(MLeft+5,MTop+7,Text);
	}
コード例 #11
0
ファイル: CPROJECT.C プロジェクト: ayushjain515/Stock-Tracker
 //*for end screen *//
void endscr()
 {
 int gd=DETECT,gm;
 initgraph(&gd,&gm,PATH);
 setfillstyle(SOLID_FILL,RED);
 bar(0,0,640,480);
 setfillstyle(SOLID_FILL,WHITE);
 bar(15,15,625,465);
 setfillstyle(SOLID_FILL,RED);
 bar(30,30,610,450);
 settextstyle(1,0,8);
 setcolor(WHITE);
 outtextxy(190,35,"GET");
 setfillstyle(SOLID_FILL,LIGHTGRAY);
 bar3d(180,140,385,130,20,20);
 outtextxy(160,150,"WELL");
 bar3d(140,255,440,245,20,20);
 outtextxy(165,270,"SOON");
 bar3d(145,375,440,365,20,20);
 getch();
 closegraph();
 restorecrtmode();
 }
コード例 #12
0
void zoomin()
{
int m,rad=getmaxy()/2-40,x1=getmaxx()/2,y1=getmaxy()/2,i;
char pattern[8] = {0x00, 0x70, 0x20, 0x27, 0x25, 0x27, 0x04, 0x04};
clrscr();
setfillpattern(pattern,RED);
bar3d(0,0,getmaxx(),getmaxy(),2,2);
bar(1,1,getmaxx()-1,getmaxy()-1);
rectangle(2,2,getmaxx()-2,getmaxy()-2);
setfillstyle(SOLID_FILL,RED);
setcolor(WHITE);
bar(80,80,getmaxx()-80,getmaxy()-80);
for(i=80;i<=90;i++)
{
delay(80);
rectangle(i,i,getmaxx()-i,getmaxy()-i);
}
setcolor(BLACK);
settextstyle(1,0,5);
outtextxy(187,95,"Developed By");
outtextxy(187,330,"Developed By");
settextstyle(1,1,5);
setcolor(WHITE);
outtextxy(94,98,"Developed By");
outtextxy(475,98,"Developed By");
setcolor(WHITE);
settextstyle(8,0,3);
outtextxy(220,170," Manohar Negi");
outtextxy(220,210,"  III Semester");
outtextxy(220,250,"  Info. Science");
outtextxy(220,290,"     R.V.C.E. ");
setcolor(11);
rectangle(190,150,450,330);
delay(3000);
for(m=0;m<6;m++)
{
cleardevice();
setcolor(RED);
circle(x1,y1,rad);
circle(x1,y1,rad-2);
rad=rad-50;
delay(200);
}
exit(0);
}
コード例 #13
0
ファイル: MAKEBAR.CPP プロジェクト: paraler/bashrc
void main()
{
	int NUM,I,VALUE[50];
	int driver=DETECT,mode;

	registerbgidriver(EGAVGA_driver);
	initgraph(&driver,&mode,"");

	NUM=READ_NUM();
	for(I=1;I<=NUM;I++)
		VALUE[I]=READ_HIGHT(I);
	setcolor(WHITE);
	line(0,400,639,400);
	setcolor(YELLOW);
	setfillstyle(1,BLUE);
	for(I=1;I<=NUM;I++)
		bar3d(I*10,400-VALUE[I],(I+1)*10,400,10,1);
	getch();
	closegraph();
}
コード例 #14
0
ファイル: Bankinterface.cpp プロジェクト: pg20/Banking_system
void info::newacc()
{      page=1;
       setfillstyle(1,15);
       bar3d(160,8,632,455,4,1);
       setcolor(6);

	 settextstyle(4,0,4);
	  outtextxy(200,40,"Enter the following details:");
	settextstyle(3,0,1);
	outtextxy(160,100,"Name");
	rectangle(250,105,600,120);

	outtextxy(160,135,"Password");
	rectangle(250,140,600,155);

	outtextxy(160,170,"Gender");
	rectangle(250,175,275,190);

	outtextxy(160,205,"Address");
	rectangle(250,210,600,225);

	outtextxy(160,240,"City");
	rectangle(250,245,600,260);

	outtextxy(160,275,"State");
	rectangle(250,280,600,295);

	outtextxy(160,310,"Pin Code");
	rectangle(250,315,400,330);

	outtextxy(160,345,"Mobile no.");
	rectangle(250,350,600,365);

	outtextxy(160,380,"E-Mail ID");
	rectangle(250,385,600,400);

	outtextxy(160,415,"Deposit");
	rectangle(250,420,600,435);
	 insert(page);
  }
コード例 #15
0
ファイル: SEIS.CPP プロジェクト: agudeloandres/C_Struct_Files
int main(void)
{
   /* request auto detection */
   int gdriver = DETECT, gmode, errorcode;
   int midx, midy, i;

   /* initialize graphics, local variables*/
   initgraph(&gdriver, &gmode, "");

   /* read result of initialization */
   errorcode = graphresult();
   if (errorcode != grOk)  /* an error
       occurred */
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");
      getch();
      exit(1); /* terminate with error code */
   }

   midx = getmaxx() / 2;
   midy = getmaxy() / 2;

   /* loop through the fill patterns */
   for (i=EMPTY_FILL; i<USER_FILL; i++)
   {
      /* set the fill style */
      setfillstyle(i, getmaxcolor());

      /* draw the 3-d bar */
      bar3d(50, 50, 350,90, 10, 1);

      getch();
   }

   /* clean up */
   closegraph();
   return 0;
}
コード例 #16
0
ファイル: QGM 3 (4)(2).CPP プロジェクト: clapslate/QGM
//------------------------- MAIN ----------------------------------
void main()
{

       int av2=-8,av3=-8,diff=0,gflag = 0;
	char ans='1';

	/*textmode(64);
	textbackground(15);
	textcolor(0);
	gotoxy(37,2);
	cout<<"STAGE 1\n";*/

	settextstyle(3,0,2);
	outtextxy(250,100,"Quick Gun Murugan");
	settextstyle(3,0,1);
	outtextxy(100,120,"1.Play the Game");
	outtextxy(100,140,"2.HighScores");
	outtextxy(100,160,"3.Instructions");
	outtextxy(120,180,"3a.Select the cursor to play the Game");
	outtextxy(120,200,"3b.Hit the Head(Circular part) of Person");
	outtextxy(120,220,"3c.For every Hit your Score will be increased by 1");
	outtextxy(120,240,"3d.For every Miss your Score will be decreased by 3");

	outtextxy(400,360,"Made by:");
	outtextxy(430,380,"Mohit Gvalani(076039)");
	outtextxy(430,400,"Tarun Hasija(076041)");
	outtextxy(430,420,"Dhiraj Jagiasi(076046)");
	getch();
	setgraphmode(2);
	registerbgidriver(EGAVGA_driver);
	registerfarbgifont(sansserif_font_far);
	registerfarbgifont(gothic_font_far);
	registerfarbgifont(triplex_font_far);
	cout<<endl<<registerfarbgifont(bold_font_far);
	cout<<endl<<registerfarbgifont(tscr_font_far);
	//cout<<endl<<registerbgifont(bold_font);
	//cout<<endl<<registerbgifont(tscr_font);
	//getch();

	int gdriver = VGA;
	int gmode = 2;
	initgraph(&gdriver, &gmode, "C:\\TC\\BGI");           // initialize graph


	gotoxy(20,20);
	setfillstyle(11,LIGHTGRAY);
	bar(0,0,getmaxx(),getmaxy());
	settextstyle(4,0,8);
	setcolor(WHITE);
	outtextxy(175,100,"STAGE 1");
	settextstyle(3,0,6);
	setcolor(GREEN);
	outtextxy(120,200,"Catch the Zombie");

	char mess[] = "\nMr.Murugan, you have to catch a Zombie before he runs away.\nYou'll be given a Maths Question with 4 possible answers.\nPress the appropriate number to give your answer(1,2,3 or 4).\nIf your answer is correct, the Zombie will be caught. Else he'll escape.\nGood Luck!\n";
	int som = sizeof(mess)/sizeof(char);
	for(int i=0; i<som; i++)
	{
		cout<<mess[i];
		delay(60);
	}
	//gotoxy(20,30);
	textcolor(RED+BLINK);
	cout<<"Press any key to start";

	getch();

	//setgraphmode(1);
	setgraphmode(2);

	setfillstyle(0,BLACK);
	bar(0,0,getmaxx(),getmaxy());
	setcolor(150);
	setfillstyle(1,150);
	setlinestyle(0,1,3);
	bar3d(-50,350,getmaxx()-50,getmaxy(),120,10);
	line(getmaxx()-50,getmaxy(),getmaxx()+100,getmaxy()-100);
	setcolor(0);
	line(70,348,70,263);
	setlinestyle(0,0,1);
	setcolor(15);
	settextstyle(1,0,0);
	settextstyle(10,0,2);
	setcolor(90);
	outtextxy(150,400,"Quick Gun Murugan");
	settextstyle(3,0,4);
	int deltime=20;


	line(lh[0][0],lh[0][1],lh[1][0],lh[1][1]);
	line(rh[0][0],rh[0][1],rh[1][0],rh[1][1]);
	line(mo[0][0],mo[0][1],mo[1][0],mo[1][1]);
	line(yo[0][0],yo[0][1],yo[1][0],yo[1][1]);
	line(t[0][0],t[0][1],t[1][0],t[1][1]);
	circle(h[0][0],h[0][1],20);



	randomize();
	int n1 = random(100);
	int n2 = random(100);
	int n3 = 0;
	n3 = n1*n2;
	/*gotoxy(0,0);
	moverel(x,y);
	delline();delline();delline();delline();delline();delline();*/
	cout<<"\nQ: "<<n1<<" x "<<n2<<" = ?\n";

	cout<<"1."<<random(5000)<<"   2."<<n3<<"   3."<<random(2000)<<"   4."<<random(8000);

	do
	{
 //-------------------------STEP1-------RED------------------------
		do
		{
			setcolor(0);
			circle(h[0][0],h[0][1],20);
			line(lh[0][0],lh[0][1],lh[1][0],lh[1][1]);
			line(rh[0][0],rh[0][1],rh[1][0],rh[1][1]);
			line(yo[0][0],yo[0][1],yo[1][0],yo[1][1]);
			line(mo[0][0],mo[0][1],mo[1][0],mo[1][1]);
			line(t[0][0],t[0][1],t[1][0],t[1][1]);

			setcolor(15);
			rotate(rh,-av2/4,yo[1][0],yo[1][1]);
			rotate(lh,-av2/4,yo[1][0],yo[1][1]);
			rotate(yo,-av2/4,yo[1][0],yo[1][1]);
			rotate(mo,-av2/4,yo[1][0],yo[1][1]);
			rotate(t,-av2/4,yo[1][0],yo[1][1]);
			rotate(h,-av2/4,yo[1][0],yo[1][1]);

			line(lh[0][0],lh[0][1],lh[1][0],lh[1][1]);
			line(rh[0][0],rh[0][1],rh[1][0],rh[1][1]);
			line(mo[0][0],mo[0][1],mo[1][0],mo[1][1]);
			line(yo[0][0],yo[0][1],yo[1][0],yo[1][1]);
			line(t[0][0],t[0][1],t[1][0],t[1][1]);
			circle(h[0][0],h[0][1],20);

			delay(deltime);
			if(kbhit())
			{
				flag=1;
				break;
			}
		}
		while(yo[0][0]<=yo[1][0]);

		if(flag==1)
			break;

   //-------------------------STEP2------------GREEN-------------------
		 diff = yo[1][0]-mo[1][0];
		 //cout<<diff<<endl<<mo[1][0]-yo[1][0];
		 do
		 {
			setcolor(0);
			line(mo[0][0],mo[0][1],mo[1][0],mo[1][1]);

			setcolor(15);
			rotate(mo,av3/2,mo[0][0],mo[0][1]);
			line(mo[0][0],mo[0][1],mo[1][0],mo[1][1]);
			delay(deltime);

			if(kbhit())
			{
				flag=1;
				break;
			}
		 }
		 while(mo[1][0]-yo[1][0]<=diff);

		 if(flag==1)
			break;

 //-------------------------STEP3----------BLUE---------------------

		while(mo[1][1] < 301)
		{
			setcolor(0);
			circle(h[0][0],h[0][1],20);
			line(lh[0][0],lh[0][1],lh[1][0],lh[1][1]);
			line(rh[0][0],rh[0][1],rh[1][0],rh[1][1]);
			line(yo[0][0],yo[0][1],yo[1][0],yo[1][1]);
			line(mo[0][0],mo[0][1],mo[1][0],mo[1][1]);
			line(t[0][0],t[0][1],t[1][0],t[1][1]);

			setcolor(15);
			rotate(rh,-av2/4,yo[1][0],yo[1][1]);
			rotate(lh,-av2/4,yo[1][0],yo[1][1]);
			rotate(yo,-av2/4,yo[1][0],yo[1][1]);
			rotate(mo,-av2/4,yo[1][0],yo[1][1]);
			rotate(t,-av2/4,yo[1][0],yo[1][1]);
			rotate(h,-av2/4,yo[1][0],yo[1][1]);

			line(lh[0][0],lh[0][1],lh[1][0],lh[1][1]);
			line(rh[0][0],rh[0][1],rh[1][0],rh[1][1]);
			line(mo[0][0],mo[0][1],mo[1][0],mo[1][1]);
			line(yo[0][0],yo[0][1],yo[1][0],yo[1][1]);
			line(t[0][0],t[0][1],t[1][0],t[1][1]);
			circle(h[0][0],h[0][1],20);

			delay(deltime);

			if(kbhit())
			{
				flag=1;
				break;
			}
		}

		if(flag==1)
			break;

  //-------------------------STEP4--------YELLOW-----------------------

		do
		{
			setcolor(0);
			circle(h[0][0],h[0][1],20);
			line(lh[0][0],lh[0][1],lh[1][0],lh[1][1]);
			line(rh[0][0],rh[0][1],rh[1][0],rh[1][1]);
			line(t[0][0],t[0][1],t[1][0],t[1][1]);

			setcolor(15);
			rotate(rh,av2/4,t[1][0],t[1][1]);
			rotate(lh,av2/4,t[1][0],t[1][1]);
			rotate(t,av2/4,t[1][0],t[1][1]);
			rotate(h,av2/4,t[1][0],t[1][1]);

			line(lh[0][0],lh[0][1],lh[1][0],lh[1][1]);
			line(rh[0][0],rh[0][1],rh[1][0],rh[1][1]);
			line(t[0][0],t[0][1],t[1][0],t[1][1]);
			circle(h[0][0],h[0][1],20);

			delay(deltime);
		}
		while(t[0][0]>=t[1][0]);

		if(kbhit())
		{
			flag=1;
			break;
		}
		if(flag==1)
			break;


 // -------------------------------STEP5----------------------------

		swap();
		setcolor(0);
		circle(h[0][0],h[0][1],20);
		h[0][0] = t[0][0];
		h[0][1] = t[0][1] - 20;
		setcolor(15);
		circle(h[0][0],h[0][1],20);

 //------------------------------------------------------------------

		if(lh[1][0]>getmaxx())
			break;

	}
	while(1);
	if(flag==1)
		ans = getch();

	for(int j=0; j<=getmaxy(); j++)
		for(int k=0; k<=getmaxx(); k++)
			putpixel(k,j,0);

	gotoxy(35,15);
	if((ans=='2'))
	{
		cout<<"STAGE CLEARED";
		cout<<"\n\n\n\n\n\n              Press any key to continue.";
	}
	else
 {
	cout<<"WRONG ANSWER!\nThe Zombie escaped.\nYou're a waste!";
	cout<<"\n\n\n\n\n\n              Press any key to continue.";
	gflag = 1;
 }
	getch();


 if(gflag==0)
 {
	gotoxy(20,15);
	setfillstyle(11,LIGHTGRAY);
	bar(0,0,getmaxx(),getmaxy());
	settextstyle(4,0,8);
	setcolor(WHITE);
	outtextxy(150,50,"STAGE 2");
	settextstyle(3,0,6);
	setcolor(GREEN);
	outtextxy(140,150,"HIT the Zombie");

	char mess2[] = "\nMr.Murugan, the Zombie is now captured and straped.\nYour job is to shoot at his head and score as many points as you can.\nIf your score is the highest, you'll earn the title of 'QUCIKGUN'.\nA HIT is 1 point, a MISS is -3 points.\nIf you hit at dead centre of his head, you get +20 points.\nYou only get 3 MISSes, after which this stage terminates.\nPress appropriate number to choose gunpoint.\n1.Point(default) \n2.Gun\n3.Arrow \n4.Hour Glass \nPress any key to abort in between.\nGood Luck!\n";
	som = sizeof(mess2)/sizeof(char);
	for(i=0; i<som; i++)
	{
		cout<<mess2[i];
		delay(60);
	}

	//gotoxy(20,30);
	textcolor(RED+BLINK);
	cout<<"Press any key to start";

	//setgraphmode(1);
	//setgraphmode(2);
	char mouseopt;
	mouseopt = getch();
	char counter[15];

	setfillstyle(0,BLACK);
	bar(0,0,getmaxx(),getmaxy());






	 revert();
	//int gdriver = DETECT,gmode,errorcode;

	//cout<<"Driver : "<<getdrivername()<<"\nMode : "<<getgraphmode();
	int color = WHITE;
	//line(0,y+100,getmaxx(),y+100);            // draw ground
	int av = -2;			   	  // in degrees
	//rotate(lh,50,200,220);//lh[0][0],lh[0][1]);
	//rotate(rh,-50,200,220);//x,y+20);
	//setactivepage(0);
	initmouse();                      
	if(mouseopt=='2')
		mouseCursor(cursorgun);
	else if(mouseopt=='3')
	{}
	else if(mouseopt=='4')
		mouseCursor(cursor2);
	else
		mouseCursor(cursor);

	showmptr();
	getcood(&butt, &xi, &yi);
	//cout<<butt<<" "<<xi<<" "<<yi;
	setcolor(150);
	setfillstyle(1,150);
	setlinestyle(0,1,3);
	bar3d(-50,350,getmaxx()-50,getmaxy(),120,10);
	//bar(70,0,getmaxx(),260);
	line(getmaxx()-50,getmaxy(),getmaxx()+100,getmaxy()-100);
	setcolor(0);
	line(70,348,70,263);
	setlinestyle(0,0,1);
	setcolor(15);
	settextstyle(4,0,4);
	//settextstyle(10,0,2);
	setcolor(0);
	outtextxy(150,400,"Quick Gun Murugan");
	settextstyle(3,0,4);
	setcolor(90);
	outtextxy(10,10,"HIT : 0");
	setcolor(20);
	outtextxy(10,60,"MISS : 0");
	flag=0;
	do
	{
		hidemptr();
		setcolor(0);
		circle(x,y,20);
		line(lh[0][0],lh[0][1],lh[1][0],lh[1][1]);
		line(rh[0][0],rh[0][1],rh[1][0],rh[1][1]);
		line(ll[0][0],ll[0][1],ll[1][0],ll[1][1]);
		line(rl[0][0],rl[0][1],rl[1][0],rl[1][1]);
		line(t[0][0],t[0][1],t[1][0],t[1][1]);
		showmptr();
		//clrman();
		x+=2;
		setcolor(color);

		circle(x,y,20);
		translate(lh,2,0);
		translate(rh,2,0);
		translate(ll,2,0);
		translate(rl,2,0);
		translate(t,2,0);
		if(rotc>40)
		{
			av *= -1;
			rotc = 0;
		}

		//rotate(lh,av,/*200,220);*/lh[0][0],lh[0][1]);
		//rotate(rh,-av,/*200,220);*/x,y+20);
		//rotate(ll,av,/*200,220);*/x,y+60);
		//rotate(rl,-av,/*200,220);*/x,y+60);*/
		rotc++;
		line(lh[0][0],lh[0][1],lh[1][0],lh[1][1]);
		line(rh[0][0],rh[0][1],rh[1][0],rh[1][1]);
		line(ll[0][0],ll[0][1],ll[1][0],ll[1][1]);
		line(rl[0][0],rl[0][1],rl[1][0],rl[1][1]);
		line(t[0][0],t[0][1],t[1][0],t[1][1]);
		//cout<<lh[0][0]<<" "<<lh[0][1]<<" "<<lh[1][0]<<" "<<lh[1][1]<<"\n";
	int count = speed;
	do
	{
		//cout<<count<<" ";
		count--;
		getcood(&butt, &xi, &yi);
		delay(0); // FOR SLOWER SPEED, MAKE DELAY 1 or 2.
		if((butt & 1)==1)
		{
			line(xi-2,yi-4,xi-10,yi-8);
			line(xi-2,yi-2,xi-6,yi-4);
			line(xi-2,yi,xi-4,yi);
			line(xi-2,yi+2,xi-6,yi+4);
			line(xi-2,yi+4,xi-10,yi+8);
			sound(10);

			delay(100);

			nosound();
			hidemptr();
			setcolor(0);
			line(xi-2,yi-4,xi-10,yi-8);
			line(xi-2,yi-2,xi-6,yi-4);
			line(xi-2,yi,xi-4,yi);
			line(xi-2,yi+2,xi-6,yi+4);
			line(xi-2,yi+4,xi-10,yi+8);
			showmptr();


			getcood(&butt, &xi, &yi);

			if((butt & 1)==0)
			{
			    if((xi>x-20)&&(xi<x+20)&&(yi>y-20)&&(yi<y+20))
			    {
				//cout<<" HIT";
				hit++;
				if((xi==x)&&(yi==y))
					hit+=19;
				setfillstyle(1,0);
				setcolor(10);
				bar(300,50,400,100);
				bar(10,10,150,60);
				outtextxy(300,50,"HIT");
				sprintf(counter,"HIT :  %d",hit);
				outtextxy(10,10,counter);
				speed/=2;
				continue;
			    }
			    else
			    {
				//cout<<" MISS";
				miss++;
				setfillstyle(1,0);
				setcolor(20);
				bar(300,50,350,100);
				bar(50,60,150,110);
				outtextxy(300,50,"MISS");
				sprintf(counter,"MISS :  %d",miss);
				outtextxy(10,60,counter);

				if(miss==3)
				{
					flag=1;
					break;
				}
			   }
			}

		}
	}while(count>0);
		if(x>getmaxx()+30)
		{
			x=10;
			lh[0][0]=x;
			rh[0][0]=x;
			ll[0][0]=x;
			rl[0][0]=x;
			t[0][0]=x;
			lh[1][0]=x-30;
			ll[1][0]=x-30;
			rh[1][0]=x+30;
			rl[1][0]=x+30;
			t[1][0]=x;
		}
		if(flag==1)
		{	break;
			//getch();
			//getch();
		}
		//delay(speed);
	}
	while(!kbhit());
	if(flag==0)
		getch();
	//delay(1000);
	//clrscr();
	//setactivepage(1);
	for(j=0; j<=getmaxy(); j++)
		for(k=0; k<=getmaxx(); k++)
			putpixel(k,j,0);
 }
	//delay(500);
	hidemptr();
	setfillstyle(6,200);
	bar(0,0,getmaxx(),getmaxy());
	setcolor(87);
	settextstyle(4,0,8);
	outtextxy(50,100," GAME OVER");
	settextstyle(0,0,2);
	setcolor(76);
	char score[20];
	sprintf(score,"Your Score:  %d",(hit-3*miss));
	outtextxy(190,220,score);
	settextstyle(3,0,8);
	setcolor(10);
	outtextxy(180,300,"MIND IT!");
	settextstyle(1,0,1);
	setcolor(WHITE);
	outtextxy(170,450,"Press any key to contiue.");
	//setvisualpage(1);
	getch();
}
コード例 #17
0
void pamplet()
	{
	setcolor(7);
	settextstyle(4,0,3);
	outtextxy(190,120,"Special SuperCars Unit");
	settextstyle(0,0,0);
	line(0,330,200,264);
	line(2,330,202,264);
	line(100,350,240,280);
	line(600,330,400,270);
	line(270,350,290,300);                 //  Divider Start
	line(290,300,310,300);
	line(310,300,330,350);
	line(293,290,308,290);
	line(293,290,297,280);
	line(308,290,304,280);                 //  Divider End

	setcolor(15);
	line(0,300,210,235);
	line(0,310,210,245);         		// left road line
	line(610,300,400,240);
	line(610,310,390,245);                  // right road line
	arc(610,305,90,225,5);
	arc(560,290,90,225,5);
	arc(520,280,90,225,5);
	arc(480,268,90,225,5);
	arc(438,256,90,225,5);
	arc(405,246,90,225,5);	// - - - - - right road line parts
	arc(0,305,315,90,5);
	arc(50,290,315,90,5);
	arc(90,278,315,90,5);
	arc(130,265,315,90,5);
	arc(172,253,315,90,5);
	arc(205,242,315,90,5);	// - - - - - left road line parts

	setcolor(8);
	rectangle(50,270,55,150);
	setfillstyle(1,8);
	floodfill(53,210,8);
	bar3d(45,270,55,280,5,5);
	setfillstyle(1,BLACK);
	bar3d(43,150,57,90,6,6);
	setlinestyle(0,0,3);
	rectangle(255,261,275,276);             // Tyres
	setfillstyle(6,8);
	floodfill(260,265,8);
	rectangle(345,261,325,276);
	setfillstyle(6,8);
	floodfill(335,267,8);
	rectangle(275,238,325,253);
	setfillstyle(2,8);
	floodfill(280,240,8);
	setlinestyle(0,0,0);

	setcolor(13);
	rectangle(450,150,480,200);
	rectangle(460,200,470,250);
	outtextxy(256,250,"=");
	outtextxy(340,250,"=");

	setcolor(9);
	outtextxy(453,160,"Spd");
	outtextxy(453,170,"lmt");
	outtextxy(452,185,"55k.");

	setcolor(BLUE);
	line(270,200,330,200);
	line(270,200,260,224);
	line(260,225,339,225);
	line(339,225,330,200);
	setfillstyle(1,BLUE);
	floodfill(300,215,BLUE);

	setcolor(4);
	circle(50,100,5);
	setlinestyle(0,0,3);
	line(245,260,355,260);
	line(245,260,243,235);
	line(355,260,357,235);
	line(245,230,355,230);
	line(245,230,243,235);
	line(355,230,357,235);
	line(248,230,265,190);
	line(352,230,335,190);
	line(335,190,265,190);
	setlinestyle(0,0,0);

	setcolor(YELLOW);
	circle(50,120,5);
	setfillstyle(1,YELLOW);
	ellipse(258,242,0,360,10,5);
	ellipse(342,243,0,360,10,5);
	floodfill(258,242,YELLOW);
	floodfill(342,242,YELLOW);

	setcolor(GREEN);
	outtextxy(457,250,"/';");
	circle(50,140,5);
	circle(568,80,70);
	circle(568,80,72);
	line(115,169,175,169);
	line(115,169,145,100);
	line(145,100,175,170);
	setfillstyle(1,10);
	floodfill(568,80,GREEN);
	floodfill(145,135,GREEN);

	setcolor(BROWN);
	rectangle(560,280,580,150);
	rectangle(140,245,150,170);
	setfillstyle(1,BROWN);
	floodfill(145,210,BROWN);
	setfillstyle(1,BROWN);
	floodfill(570,200,BROWN);
	circle(284,183,5);
	circle(300,183,5);
	circle(316,183,5);
	pamplet1();
	flag=0;

      /*	Signal filling	 	*/

	setfillstyle(1,4);
	floodfill(50,100,4);                  // upper circle
	D(500);
	setfillstyle(1,YELLOW);
	floodfill(50,120,YELLOW);	      // mid circle
	D(500);
	setfillstyle(1,GREEN);
	floodfill(50,140,GREEN);              // lower circle
	D(500);

	while(!kbhit())
		{
		flag++;
		settextstyle(4,0,5);
		if(flag%2!=0)
			{
			setcolor(13);
			outtextxy(150,0,"Press Any Key..");
			delay(500);
			}
		else
			{
			setcolor(BLACK);
			outtextxy(150,0,"Press Any Key..");
			delay(200);
			}
		}
	getch();
	}
コード例 #18
0
ファイル: Bankinterface.cpp プロジェクト: pg20/Banking_system
 void info::insert(int page)
 {    date *d;
	getdate(d);
      fstream x,y;
       x.open("info.dat",ios::binary|ios::app|ios::in);
       y.open("master.dat",ios::binary|ios::app);
      // if(!y)  y.open("master.dat",ios::binary|ios::out);
       //info wr;
       if(!x && !y)
       {   cerr<<"file doesnt open";
	    getch();
	    exit(0);
       }
       fstream obj;
     if(page==1)
     {	  obj.open("ban.dat",ios::app|ios::binary);
	  if(!obj)
	  {   cerr<<"ban file doest open";
	   getch();
	   exit(0);
	   }
     }

	int i=0;
	int j=2;
	char *p;
	// _setcursortype(1);
	///////////for name insertion//////////////////
      if(page==0)
      {    name:
	    for(int k=0;k<50;k++)
		   wr.name[k]=NULL;
	 //    gotoxy(50,8);
	 //    gets(name);
	  //   exit(1);
		   setcolor(6);
		   outtextxy(250+j,135,"_");
		while((*(wr.name+i)=getch())!=13)
		{     outtextxy(250+j,135,wr.name+i);
		      i++;
		      j+=10;           //	rectangle(250,140,600,155);

		}
		   wr.name[i]='\0';
		   //setcolor(3);
		   //exit(1);
			    //bar(2,405,60,415);
		   if((wr.name[0]=='\0')&&(wr.name[1]=='\0'))
		    {	    outtextxy(2,410,"FILL NAME FIELD");
			    goto name;
		     }



      }



     if(page==1)
    {	 name1:
	    for(int k=0;k<50;k++)
		   wr.name[k]=NULL;
	 //    gotoxy(50,8);
	 //    gets(name);
	  //   exit(1);
		   setcolor(6);
		   outtextxy(250+j,100,"_");
		while((*(wr.name+i)=getch())!=13)
		{     outtextxy(250+j,100,wr.name+i);
		      i++;
		      j+=10;
		}
		   wr.name[i]='\0';
		   //setcolor(3);
		   //exit(1);
			    //bar(2,405,60,415);
		   if((wr.name[0]=='\0')&&(wr.name[1]=='\0'))
		    {	    outtextxy(2,410,"FILL NAME FIELD");
			    goto name1;
		     }
		//cout<<wr.name;
	////////////for password insertion//////////////

		entagain:

		j=0;
		i=0;
		p= new char;
		for( k=0;k<50;k++)
		     wr.pass[i]=NULL;
				   outtextxy(250+j,135,"_");
		while((*(p+i)=getche())!=13)
		 {
					  //cout<<" "<<*(p+i);
					  outtextxy(250+j,135,"*");
					  wr.pass[i]=*(p+i);
					  //M1.pass[i]=*(p+i);
					  i++;
					  j+=10;

		 }       wr.pass[i]='\0';
			 //M1.pass[i]='\0';
		 //setcolor(3);
		 //outtextxy(2,425,"pass length short");
		 setcolor(6);
			     if(i<5)
					  {
					  outtextxy(2,425,"pass length short");
					   goto entagain;
					  }
       }
			//cout<<wr.pass;
	////////////for gender insertion///////////
		j=2;
		i=0;
	   for(int k=0;k<2;k++)
		   wr.gen[k]=NULL;
		 outtextxy(250+j,170,"_");
		while(((*(wr.gen+i)=getch())!=13)&&(i==0))
		{
		      outtextxy(250+j,170,wr.gen+i);
		      //cout<<"   "<<*(wr.gen+i);
		      //wr.gen[0]=*(q+i);
		      i++;
		      j+=10;
		}     wr.gen[i]='\0';
		//cout<<"gender is   "<<wr.gen;

	///////////////for address insertion///////////////
		j=2;
		i=0;
		for(k=0;k<50;k++)
		      wr.address[k]=NULL;
		 outtextxy(250+j,205,"_");
		while((*(wr.address+i)=getche())!=13)
		{     outtextxy(250+j,205,wr.address+i);
		      i++;
		      j+=10;
		}
		   wr.address[i]='\0';
		   //cout<<"\n add is  "<<wr.address;
	//////////////////for city insertion//////////
		j=2;
		i=0;
		for(k=0;k<50;k++)
		     wr.city[k]=NULL;
		 outtextxy(250+j,240,"_");
		while((*(wr.city+i)=getche())!=13)
		{     outtextxy(250+j,240,wr.city+i);
		      i++;
		      j+=10;
		}
		wr.city[i]='\0';
	       //	cout<<"\n name of city is"<<wr.city;

	 /////////////for state insertion////////////
		j=2;
		i=0;
		for(k=0;k<50;k++)
		       wr.state[k]=NULL;
		 outtextxy(250+j,275,"_");
		while((*(wr.state+i)=getche())!=13)
		{     outtextxy(250+j,275,wr.state+i);
		      i++;
		      j+=10;
		}
		wr.state[i]='\0';
		//cout<<"\n  satte is  "<<wr.state;
	 ///////////////for pin code insertion//////////
		j=2;
		i=0;
		for(k=0;k<50;k++)
		      wr.pinc[k]=NULL;
		 outtextxy(250+j,310,"_");
		while((*(wr.pinc+i)=getche())!=13)
		{     outtextxy(250+j,310,wr.pinc+i);
		      i++;
		      j+=10;
		}
		wr.pinc[i]='\0';
	       //	cout<<"\n pin code is"<<wr.pinc;
	 ///////////////for mobile no.///////////////
		j=2;
		i=0;

		for(k=0;k<20;k++)
		     wr.mob[k]=NULL;
		      outtextxy(250+j,345,"_");
		while((*(wr.mob+i)=getche())!=13)
		{     outtextxy(250+j,345,(wr.mob+i));
		      i++;
		      j+=10;
		}
	       //	for(k=0;k<20;k++)
		   //    wr.mob[k]=(int)wr.mob[k];
		   wr.mob[i]='\0';

		      //	cout<<"mob is "<<wr.mob;
		//////////for email id insertion/////////
		i=0;
		j=2;
		for(k=0;k<20;k++)
		       wr.email[k]=NULL;
		 outtextxy(250+j,380,"_");
		while((*(wr.email+i)=getche())!=13)
		{     outtextxy(250+j,380,wr.email+i);
		      i++;
		      j+=10;
		}
		wr.email[i]='\0';

	 if(page==1)
	 {  dep:
		     gotoxy(33,27);
		     cin>>wr.dep;
		     //setcolor(3);
		     //outtextxy(2,400,"less amount");
		     if(wr.dep<1000)
		     {     	 setcolor(6);
				 outtextxy(2,440,"less amount");
				// outtextxy(2,400,"less amount");
				 goto dep;
		      }
		     a.currbal=wr.dep;
		     gotoxy(20,11);
		       //cout<<" deposit is" <<wr.dep;
		       //cout<<"\ndeposit are  "<<a.currbal;

  //////////////to store n generate account no  //////////////////////////

		/*     for(i=0;i<50;i++)
			 {	  wr.acc[0][i]=NULL;
				  a.acc_no[0][i]=NULL;
			  }*/
		  gotoxy(47,18);
		//cout<<"sixe is"<<sizeof(wr);
		 // cout<<" pper"<<x.tellg();
		//  getch();

	 // x.seekg(-(sizeof(wr)),ios::end);
	///////////////////////////////////////////////,,,,,///
	account onjj;
	fstream xy;
       xy.open("master.dat",ios::binary|ios::app|ios::in);
	int tott=0;
	 while(xy)
	  {
	  xy.read((char*)&onjj,sizeof(account));
	  tott++;
	  }
	 xy.close();
			    unsigned long a2=1000;
	    wr.acc=a2+tott+1;
	  // wr.acc[0][0]=cn;
	  // wr.acc[0][1]=++cp;
	 // cout<<"  "<<wr.acc[0];
	  a.acc_no=wr.acc;
     //	  a.acc_no[0][1]=wr.acc[0][1];
	  a.dd=d->da_day;
	  a.mm=d->da_mon;
	  a.yy=d->da_year;
	  a.transamt=wr.dep;
	  account M;
	  M.acc_no=wr.acc;
       //	  M.acc_no[0][1]=wr.acc[0][1];
	  strcpy(M.pass,wr.pass);
	  //cout<<"   a.acc no    "<<a.acc_no[0];
	  //getch();
//---       x.close();
    //   obj.close();
//---	 fstream x;
//----       x.open("info.dat",ios::binary|ios::app);
       //info wr;
       if(!x)
       {   cerr<<"file doesnt open";
	    getch();
	    exit(0);
       }
    //   fstream obj;
    // if(page==1)
      //	   obj.open("ban.dat",ios::app|ios::binary);
      //	  if(!obj)
      //	  {   cerr<<"ban file doest open";
       //	   getch();
	//   exit(0);
	 //  }

       x.write((char*)&wr,sizeof(wr));
       obj.write((char*)&a,sizeof(a));
       y.write((char*)&M,sizeof(M));
       setfillstyle(1,15);
       bar3d(160,8,632,455,4,1);
       setcolor(6);
       //for(int k=0;k<10;k++)
	  settextstyle(0,0,3);
	     outtextxy(200,40,"CONGRATULATIONS");


       outtextxy(260,100,wr.name);
       settextstyle(1,0,3);
       outtextxy(200,150,"YOUR NEW ACCOUNT IS CREATED");
	settextstyle(7,0,2);
	setcolor(2);
       outtextxy(180,200,"ACCOUNT NO IS");

	gotoxy(46,14);
	cout<<wr.acc;
      // outtextxy(360,200,wr.acc);
       //outtextxy(365,200,(char*)wr.acc[0]);
       outtextxy(180,250,"DEPOSIT IS");
       //outtextxy(340,250,wr.dep);
       gotoxy(46,17);
       cout<<wr.dep;
       x.close();
       obj.close();
       y.close();
       choice2(backkey());
     }
コード例 #19
0
ファイル: Bankinterface.cpp プロジェクト: pg20/Banking_system
 int info::choice()  //swapping between keyssssssss
{    int end;
     int i=0;
     do
     {
	   int key=getch();
	   //cout<<key;
	   switch(key)
	   {
		      case 80: switch(i)

			       {case 0:        setfillstyle(1,2);
					       bar3d(300,180,500,230,4,1);
					       setcolor(0);
					       outtextxy(303,190," Create new account");


					       setcolor(6);
					      setfillstyle(1,3);

					       bar3d(300,100,500,150,4,1);
					       outtextxy(320,110,"  Access account");

					       bar3d(300,265,500,310,4,1);
					      outtextxy(380,275,"Exit");



						i++;

						break;


				case 1:        setfillstyle(1,3);
					       bar3d(300,100,500,150,4,1);
					       setcolor(6);
					       outtextxy(320,110,"  Access account");

					       setfillstyle(1,3);
					       bar3d(300,180,500,230,4,1);
					       setcolor(6);
					       outtextxy(303,190," Create new account");

					       setfillstyle(1,2);
					       bar3d(300,265,500,310,4,1);
					       setcolor(0);
					       outtextxy(380,275,"Exit");
					       i++;
						//getch();

					       break;
			    }
			    break;
		     case 72: switch(i)
			      {     case 1:
					       setfillstyle(1,3);
					       bar3d(300,180,500,230,4,1);
						 bar3d(300,265,500,310,4,1);
					       setcolor(6);
						outtextxy(380,275,"Exit");
					       outtextxy(303,190," Create new account");

					       setcolor(0);
					       setfillstyle(1,2);
					       bar3d(300,100,500,150,4,1);
					       outtextxy(320,110,"  Access account");
					       i--;
					       break;
				    case 2:    setcolor(0);
					       setfillstyle(1,2);
					       bar3d(300,180,500,230,4,1);
					       outtextxy(303,190," Create new account");

					       setcolor(6);
					       setfillstyle(1,3);
					       bar3d(300,265,500,310,4,1);
					       outtextxy(380,275,"Exit");
					       bar3d(300,100,500,150,4,1);
					       outtextxy(320,110,"  Access account");
					       i--;
					       break;
				  }
				  break;
		     case 13:end=1;
	    }
	}while(end!=1);

	return(i);
 }
コード例 #20
0
int main(void)
{
   /* request auto detection */
   int gdriver = DETECT, gmode, errorcode;
   int t,i,k,numeros;

   /* initialize graphics and local
      variables */
   initgraph(&gdriver, &gmode, "");

   /* read result of initialization */
   errorcode = graphresult();
   if (errorcode != grOk)  /* an error
       occurred */
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");
      getch();
      exit(1); /* terminate with an error
		  code */
   }



   outtextxy(116,60,"[1] *.bak");
   outtextxy(116,80,"[2] *.obj");
   outtextxy(116,100,"[3] *.exe [No recomendable]");
   outtextxy(116,120,"[4]  Todo [denegado ]");
   outtextxy(116,140,"Sin una opcion definida se hara el Default.");
   outtextxy(116,165,"Opcion ? [   ]");
   gotoxy(26,11);scanf("%d",&numeros);

   delay(700);
  cleardevice();

   for (t=1;t<=13;t++) {
   setcolor(t);
    outtextxy(150,20,"Escaneando la Unidad, tenga paciencia!");
    delay(60);
    }

    /* draw the 3-d bar */
      bar3d(100, 100, 400,140, 10, 1);

   /* loop through the fill patterns */
   k=0;
   for (i=100; i<=401; i++)
   {

      /* set the fill style */
      setfillstyle(1, BLUE);
      /* draw the bar */
    bar(100, 100, i,140);
    gotoxy (35,10);printf("%d%",k);
    k=(400-i);
    delay(10);
      }


   switch (numeros)  {

   case 1:
	system("dir *.bak");
	system("del *.bak");
	delay(700);
	break;

    case 2:
	system("dir *.obj");
	system("del *.obj");
	delay(700);
	break;

     case 3:
	system("dir *.exe");
	system("rename elimina.exe elimina.ira");
	system("del *.bak");
	system("rename elimina.ira elimina.exe");
	delay(700);
	break;

    case 4:
	system("dir *.*");
       gotoxy(25,25);printf("Esta funcion no esta activada, te jodes!");
	delay(900);
     //	system("del *.bak");
	break;

     default:
	gotoxy(25,25);printf("No es una opcion valida!");
	 delay(900);
    }



    cleardevice();
    settextstyle(5,0,4);
    for (t=1;t<=13;t++) {
    setcolor(t);
    outtextxy(150,20,"Unidad limpiada con exito!");
    delay(60);
    }
    settextstyle(8,0,3);
    for (t=1;t<=13;t++) {
    setcolor(t);
    outtextxy(150,300,"Presione una tecla para finalizar!");
    delay(60);
    }

    getch();
   /* clean up */
   closegraph();
   return 0;
}
コード例 #21
0
ファイル: PRO24.CPP プロジェクト: RITIK-SRIVASTAVA/diad
int main()
{int i=300,jj=0,p=0,q=0,a,v,h,b,res,w=0,e=0,r=0,j=100,x=0,kk[6][6],y=0,ch=0,gd=DETECT,gm,k,l;
 int str[18][5]={222,420,140,35,100,
		 13,260,150,70,60,
		 435,120,35,456,354,
		 35,54,32,432,98,
		 334,30,545,24,12,
		 10,90,49,46,234,
		 112,32,121,600,225,
		 729,16,98,564,875,
		 76,86,86,974,36,
		 780,660,732,96,208,
		 31,75,568,930,836,
		 32,22,765,312,54,
		 65,54,86,50,90,
		 570,352,46,27,35,
		 786,540,314,876,289,
		 230,372,948,938,732,
		 328,244,144,134,385,
		 456,382,395,85,384
		 };
 char pop[5],arr[2][25]={" ","RULES AND REGULATION :"};
 int score=0;
 initgraph(&gd,&gm,"C:\\TC\\BGI");

int pos[200][8];
setbkcolor(5);

for(a=0;a<=200;a++)
{ for(b=0;b<=8;b++)
  {pos[a][b]=0;
  }
}
for(a=0;a<=6;a++)
{for(b=0;b<=6;b++)
 {kk[a][b]=0;
 }
}
b=0;

for(a=2;a<30;a++)
{line(1,a,1000,a);
a++;
}

 setfillstyle(1,14);
 settextstyle(TRIPLEX_FONT,HORIZ_DIR,9);
 b=0;
 setfillstyle(1,8);
 bar(550,60+b,620,160+b);
 b=b+100;
 setfillstyle(1,58);
 bar(550,60+b,620,160+b);
 b=b+100;

 setfillstyle(1,14);
 bar(550,60+b,620,160+b);

 b+=100;
 setfillstyle(1,1);
 bar(550,60+b,620,160+b);

  setcolor(15);
  outtextxy(560,50,"T");
  setcolor(0);
  outtextxy(560,150,"E");
  setcolor(2);
  outtextxy(560,250,"C");
  setcolor(14);
  outtextxy(555,350,"H");
  setcolor(9);
  settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
  setcolor(15);
  outtextxy(160,50,"MATHEMATICAL DYAD");
  setfillstyle(6,15);
  bar(140,90,500,95);
settextstyle(TRIPLEX_FONT,HORIZ_DIR,1);
setcolor(15);
outtextxy(30,120,arr[1]);
bar(20,145,270,150);
outtextxy(30,160,"Rule 1: Points are awarded when numbers are paired");
outtextxy(90,180," as multiples (vertically) and the lower number");
outtextxy(90,200," is greater. ");
outtextxy(30,230,"Rule 2: Points are deducted when numbers are paired");
outtextxy(90,250," as multiples (vertically) and the lower number");
outtextxy(90,270," is smaller. ");
outtextxy(30,300,"Rule 3: The HCF of the two adjacent numbers");
outtextxy(90,320," (horizontally) is divided from both the numbers");
outtextxy(90,340," and points are awarded accordingly.");
outtextxy(30,370,"Rule 4: 1 being a special number, no points are ");
outtextxy(90,390," awarded or deducted when numbers are paired");
outtextxy(90,410," with 1. ");
outtextxy(90,430,"            Press spacebar to continue");

  settextstyle(TRIPLEX_FONT,HORIZ_DIR,1);
  ch=getch();
for(a=0;;a++)
{if(ch==32)
  {break;
  }
  else
 {ch=getch();
 }
}
  cleardevice();
  setbkcolor(9);
  for(a=2;a<30;a++)
{line(1,a,1000,a);
a++;
}
setfillstyle(1,14);
settextstyle(TRIPLEX_FONT,HORIZ_DIR,9);
   b=0;
   setfillstyle(1,8);
   bar(550,60+b,620,160+b);
   b=b+100;
   setfillstyle(1,58);
   bar(550,60+b,620,160+b);
   b=b+100;

setfillstyle(1,14);
bar(550,60+b,620,160+b);
b+=100;
setfillstyle(1,1);

bar(550,60+b,620,160+b);

setcolor(15);
  outtextxy(560,50,"T");
  setcolor(0);
  outtextxy(560,150,"E");
  setcolor(2);
  outtextxy(560,250,"C");
  setcolor(14);
  outtextxy(555,350,"H");
  setcolor(9);
settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
setcolor(15);
outtextxy(160,50,"MATHEMATICAL DYAD");
setfillstyle(8,15);
bar(140,90,510,95);

  settextstyle(TRIPLEX_FONT,HORIZ_DIR,1);
  setfillstyle(5,15);
  b=0;

  for(a=0;a<=6;a++)
  {
   bar(185, 125+b,415,130+b);
   b+=45;
   }
   b=0;
   for(a=0;a<=5;a++)
    { bar(185+b,125,190+b,395);
      b+=45;
    }
	setcolor(15);
	settextstyle(TRIPLEX_FONT,HORIZ_DIR,1);
	setfillstyle(1,1);
	bar3d(55,130,155,170,5,5);
	bar3d(55,180,155,220,5,5);
	bar3d(55,230,155,270,5,5);
	bar3d(55,280,155,320,5,5);
	bar3d(55,330,155,370,5,5);
	     outtextxy(65,140,"LEFT");
	     outtextxy(65,190,"DOWN");
	     outtextxy(65,240,"RIGHT");
	     outtextxy(65,290,"ESC");
	     outtextxy(65,340,"'H' HALT");

 for(p=0;p<=18;p++)
 {
  for(q=0;q<5;q++)
   { setcolor(15);
    i=300;
    j=150;
    x=0;
    y=0;
    ascii(str[p][q],pop,score);
    res=check(kk,pos,i,j,x,y,jj,score);
    if(res==1)
    {scoring(score,pos);
    }

   while(ch!=1)
   {
    settextstyle(TRIPLEX_FONT,HORIZ_DIR,1);

    /*"DEFAULT font","TRIPLEX fontSMALL font","SMALL font",
      "SANS SERIF font","GOTHIC font" */

   a=result(kk,pos,jj,score);
   a=side(kk,jj,pos,score);
   a=result(kk,pos,jj,score);
   setfillstyle(1,1);
   bar(i-20,j-20,i+20,j+20);
   if(str[p][q]>=100)
   {outtextxy(i-15,j-7,pop);
   }
   else if(str[p][q]<100)
   {outtextxy(i-7,j-7,pop);
   }

   delay(500);

   if(kbhit())
    {  a=side(kk,jj,pos,score);
       ch=getch();

      if(ch==75)
	{x=-45;
	 y=0;

       }
      if(ch==77)
      {x=45;
       y=0;
      }

      if(ch==72||ch==104)
     {  settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
	ch=0;

	for(a=2;;a++)
       {setfillstyle(1,60);
	bar(420,130,540,180);
	setcolor(15);
	settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
	outtextxy(445,140,"HALT");

	setfillstyle(1,1);
	bar(420,190,540,250);
	setfillstyle(1,15);
	bar(460,200,475,240);
	bar(485,200,500,240);
	delay(1000);

	setfillstyle(1,1);
	bar(420,190,540,250);

	delay(1000);

	setcolor(15);
	settextstyle(TRIPLEX_FONT,HORIZ_DIR,1);
	outtextxy(90,420,"       Press 'R' to resume the game !!");

	if(kbhit())
	 {ch=getch();
	  if(ch==82||ch==114)
	   {ch=0;
	   setfillstyle(1,9);
	   bar(420,130,540,180);
	   bar(420,190,540,250);
	   bar(80,410,500,450);

	   goto lable2;
	   }
       }

     }
     }
     lable2:
     settextstyle(TRIPLEX_FONT,HORIZ_DIR,1);
     setcolor(15);

      if(ch==97||ch==65)
      { goto lable;
      }
      if(ch==80)
      {x=0;
       y=45;
      }
      if(ch==27)
      {  delay(2000);
	 cleardevice();
	 setbkcolor(14);
	 setcolor(1);
	 settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);

	 outtextxy(220,110,"GAME OVER !!");
	 setfillstyle(1,4);
	 bar(210,170,430,250);
	 setcolor(15);
	 outtextxy(230,200,"SCORE : " );
	 ascii(score,pop,score);
	 if(score==0)
	   {outtextxy(475,200,"0");
	    }
	 else if(score>0&&score<10)
	   { outtextxy(370,200,pop );
	   }
	 else if(score>=10&&score<100)
	   { outtextxy(365,200,pop );
	   }
	 else if(score>99&&score<1000)
	   { outtextxy(350,200,pop);
	    }
	 else if(score>999)
	   { outtextxy(345,200,pop);
	   }



	 setcolor(2);
	 settextstyle(TRIPLEX_FONT,HORIZ_DIR,3);

	 outtextxy(120,250,"We hope that you enjoyed our game" );
	 outtextxy(120,290,"to the fullest. Please give your " );
	 outtextxy(120,330,"prescious feedback on our website " );
	 setcolor(12);
	 outtextxy(200,370,"www.catexpo_games.com " );
	 getch();
	 closegraph();
	 exit(0);
	      }

      if((i+x)>390)
      {x=0;
      }
      if((i+x)<210)
      {x=0;
      }
     if((y+j)>375)
     { y=0;
       ch=1;
     }
      setfillstyle(3,9);
      res=check(kk,pos,i,j,x,y,jj,score);
      if(res==0)
       {
      delay(100);
      bar(i-20,j-20,i+20,j+20);
      i=i+x;
      j=j+y;

      setfillstyle(1,1);
      bar(i-20,j-20,i+20,j+20);
       if(str[p][q]>=100)
	  {outtextxy(i-15,j-7,pop);
	  }
       else if(str[p][q]<100)
	 {outtextxy(i-7,j-7,pop);
	 }

      x=0;
      y=0;

      a=result(kk,pos,jj,score);
      a=side(kk,jj,pos,score);
      scoring(score,pos);
      a=result(kk,pos,jj,score);
      scoring(score,pos);
       }

      }

  else
  {
   if((j+45)>375)
   {
    y=0;

    ch=1;
    a=result(kk,pos,jj,score);
    scoring(score,pos);
    a=side(kk,jj,pos,score);
    scoring(score,pos);
    a=result(kk,pos,jj,score);
    scoring(score,pos);
   }
   else
   {y=45;
    x=0;
    res=check(kk,pos,i,j,x,y,jj,score);
    if(res==0)
       {
	setfillstyle(1,9);
	bar(i-20,j-20,i+20,j+20);
	j=j+45;
	i=i+x;
       }
      else
      {
      ch=1;
      }

    }
    a=result(kk,pos,jj,score);
    scoring(score,pos);
    a=side(kk,jj,pos,score);
    scoring(score,pos);
    a=result(kk,pos,jj,score);
    scoring(score,pos);
 }
 }
 pos[jj][0]=i;
 pos[jj][1]=j;

 w=0;
 e=0;
 r=0;

 for(a=210;a<=390;)
 {
  if(i==a)
   { e=r;
   }
   r++ ;
   a=a+45;
 }
 r=5;

 for(b=375;b>=100;)
 {if(j==b)
   { w=r;
   }
   r-- ;
   b=b-45;
 }

kk[w][e]=str[p][q];

ch=0;
r=0;
i=300;
j=150;
e=0;
w=0;
x=0;
jj++;
y=0;

}

    a=result(kk,pos,jj,score);
    scoring(score,pos);
    a=side(kk,jj,pos,score);
    scoring(score,pos);
    a=result(kk,pos,jj,score);
    scoring(score,pos);
}
lable:
cleardevice();
closegraph();
getch();
return 0;
}
コード例 #22
0
void insertq(int *rear,char c)
{
int l=320,i,l2;
int m=170;
l2=l+40;
s[1]=4;
setcolor(GREEN);
setfillstyle(SOLID_FILL,WHITE);
if(*rear==-1)
{
bar3d(l,m,l2,m+40,1,0);
rectangle(l,m,l+40,m+40);
switch(c)
{
case '0':
	outtextxy(l+20,m+20,"0");
	break;
case '1':
	outtextxy(l+20,m+20,"1");
	break;
case '2':
	outtextxy(l+20,m+20,"2");
	break;
case '3':
	outtextxy(l+20,m+20,"3");
	break;
case '4':
	outtextxy(l+20,m+20,"4");
	break;
case '5':
	outtextxy(l+20,m+20,"5");
	break;
case '6':
	outtextxy(l+20,m+20,"6");
	break;
case '7':
	outtextxy(l+20,m+20,"7");
	break;
case '8':
	outtextxy(l+20,m+20,"8");
	break;
case '9':
	outtextxy(l+20,m+20,"9");
	break;
}
}
if(*rear==0)
{
bar3d(l+40,m,l2+40,m+40,1,0);
rectangle(l,m,l+40,m+40);
switch(c)
{
case '0':
	outtextxy(l+60,m+20,"0");
	break;
case '1':
	outtextxy(l+60,m+20,"1");
	break;
case '2':
	outtextxy(l+60,m+20,"2");
	break;
case '3':
	outtextxy(l+60,m+20,"3");
	break;
case '4':
	outtextxy(l+60,m+20,"4");
	break;
case '5':
	outtextxy(l+60,m+20,"5");
	break;
case '6':
	outtextxy(l+60,m+20,"6");
	break;
case '7':
	outtextxy(l+60,m+20,"7");
	break;
case '8':
	outtextxy(l+60,m+20,"8");
	break;
case '9':
	outtextxy(l+60,m+20,"9");
	break;
}
}
if(*rear==1)
{
bar3d(l+80,m,l2+80,m+40,1,0);
rectangle(l,m,l+40,m+40);
switch(c)
{
case '0':
	outtextxy(l+100,m+20,"0");
	break;
case '1':
	outtextxy(l+100,m+20,"1");
	break;
case '2':
	outtextxy(l+100,m+20,"2");
	break;
case '3':
	outtextxy(l+100,m+20,"3");
	break;
case '4':
	outtextxy(l+100,m+20,"4");
	break;
case '5':
	outtextxy(l+100,m+20,"5");
	break;
case '6':
	outtextxy(l+100,m+20,"6");
	break;
case '7':
	outtextxy(l+100,m+20,"7");
	break;
case '8':
	outtextxy(l+100,m+20,"8");
	break;
case '9':
	outtextxy(l+100,m+20,"9");
	break;
}
}
if(*rear==2)
{
bar3d(l+120,m,l2+120,m+40,1,0);
rectangle(l,m,l+40,m+40);
switch(c)
{
case '0':
	outtextxy(l+140,m+20,"0");
	break;
case '1':
	outtextxy(l+140,m+20,"1");
	break;
case '2':
	outtextxy(l+140,m+20,"2");
	break;
case '3':
	outtextxy(l+140,m+20,"3");
	break;
case '4':
	outtextxy(l+140,m+20,"4");
	break;
case '5':
	outtextxy(l+140,m+20,"5");
	break;
case '6':
	outtextxy(l+140,m+20,"6");
	break;
case '7':
	outtextxy(l+140,m+20,"7");
	break;
case '8':
	outtextxy(l+140,m+20,"8");
	break;
case '9':
	outtextxy(l+140,m+20,"9");
	break;
}
}
if(*rear==3)
{
bar3d(l+160,m,l2+160,m+40,1,0);
rectangle(l,m,l+40,m+40);
switch(c)
{
case '0':
	outtextxy(l+180,m+20,"0");
	break;
case '1':
	outtextxy(l+180,m+20,"1");
	break;
case '2':
	outtextxy(l+180,m+20,"2");
	break;
case '3':
	outtextxy(l+180,m+20,"3");
	break;
case '4':
	outtextxy(l+180,m+20,"4");
	break;
case '5':
	outtextxy(l+180,m+20,"5");
	break;
case '6':
	outtextxy(l+180,m+20,"6");
	break;
case '7':
	outtextxy(l+180,m+20,"7");
	break;
case '8':
	outtextxy(l+180,m+20,"8");
	break;
case '9':
	outtextxy(l+180,m+20,"9");
	break;
}
}
}
コード例 #23
0
void standard()
{
	int i,j,k=0;
	int a=150,b=105;
	unsigned long gsize;
    
/*计算器按钮标签文本字符 */
	char str[][5]={"1","2","3","-","/","4","5","6","*","Sqrt","7","8","9","1/x","C"};
	char temp[6]="";
	InitGraph();
	cleardevice();
	setbkcolor(BLACK);
	setfillstyle(SOLID_FILL,LIGHTGRAY);
	bar3d(130,45,500,280,10,1);        /* 计算器外框 */
	setcolor(DARKGRAY);
	line(150,60,150,90);
	line(150,90,480,90);
	setcolor(WHITE);
	line(150,60,480,60);
	line(480,60,480,90);
	setfillstyle(SOLID_FILL,YELLOW);
	bar(150,60,480,90);            /* 绘制信息显示框 */
	setfillstyle(SOLID_FILL,LIGHTGRAY);

	for(i=0;i<5;i++)                /* 绘制计算器按钮框 */
	     for(j=0;j<4;j++)
		  {
		      bar(a+i*70,b+j*45,a+50+i*70,b+30+j*45);
		      bottonup(a+i*70,a+i*70+50,b+j*45,b+j*45+30);
		  }

       setcolor(YELLOW);
       settextstyle(1,0,1);

       bar(120,315,550,345);
	   bottonup(120,550,315,345);
	   bar(120,350,550,380);
	   bottonup(120,550,350,380);
	   bar(120,385,550,415);
	   bottonup(120,550,385,415);
	   bar(120,420,550,470);
	   bottonup(120,550,420,470);
	   setcolor(YELLOW);
       settextstyle(1,0,1);
       outtextxy(30,290,"control with left-click or keyboard,right-click or Esc to exit.");
       outtextxy(130,321,"Switch to scientific mode.");
       outtextxy(130,356,"Switch to statistics mode.");
       outtextxy(130,391,"switch to high-precision calculation mode.");

       settextstyle(1,0,3);
       setcolor(RED);
       outtextxy(283,433,"HELP");
	   settextstyle(1,0,3);
       setcolor(YELLOW);
	   outtextxy(260,10,"standard mode");
       settextstyle(1,0,2);
       setcolor(GREEN);
       for(j=0;j<3;j++)
	   for(i=0;i<5;i++)        /* 显示计算器前三排按钮标签 */
	   {
		     strcpy(temp,str[k++]);
			 if (temp[0]=='S') {outtextxy(a+6+70*i,200-j*45,temp);continue;}
			 if (temp[0]=='1') {outtextxy(a+10+70*i,200-j*45,temp);continue;}
		     outtextxy(a+17+70*i,200-j*45,temp);
	   }
       outtextxy(167,245,"0"); /* 显示计算器最后一排按钮标签 */
       outtextxy(377,245,"+");
       outtextxy(447,245,"=");
       settextstyle(1,0,3);
       outtextxy(310,235,".");
       settextstyle(1,0,2);
       outtextxy(228,243,"+");
       outtextxy(237,246,"/");
       outtextxy(246,250,"-");
       setcolor(BLACK);
}