当前位置: 首页>>代码示例>>C++>>正文


C++ cleardevice函数代码示例

本文整理汇总了C++中cleardevice函数的典型用法代码示例。如果您正苦于以下问题:C++ cleardevice函数的具体用法?C++ cleardevice怎么用?C++ cleardevice使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cleardevice函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CheckWin

int CheckWin(){
	if(bla != 0 && whi != 0 && count < 64){
		if(stopcheck == 0)
			return 1;
		else if(stopcheck == 1){
			if(bla > whi){
				cleardevice();
				outtextxy(320,210,"Black Win!");
				outtextxy(320,280,"Press any key to continue");
				return 0;
			}
			else if(bla < whi){
				cleardevice();
				outtextxy(320,210,"White Win!");
				outtextxy(320,280,"Press any key to continue");
				return 0;
			}
			else{
				cleardevice();
				outtextxy(320,210,"Tie to Tie!");
				outtextxy(320,280,"Press any key to continue");
				return 0;
			}
		}
	}
	else if(bla == 0 && whi != 0){
		cleardevice();
		outtextxy(320,210,"White Win!");
		outtextxy(320,280,"Press any key to continue");
		return 0;
	}else if(whi == 0 && bla != 0){
		cleardevice();
		outtextxy(320,210,"Black Win!");
		outtextxy(320,280,"Press any key to continue");
		return 0;
	}else if(count == 64){
		if(bla > whi){		
			cleardevice();
			outtextxy(320,210,"Black Win!");
			outtextxy(320,280,"Press any key to continue");
			return 0;
		}else if(bla < whi){
			cleardevice();
			outtextxy(320,210,"White Win!");
			outtextxy(320,280,"Press any key to continue");
			return 0;
		}else{
			cleardevice();
			outtextxy(320,210,"Tie to Tie!");
			outtextxy(320,280,"Press any key to continue");
			return 0;
		}
	}
}
开发者ID:reAsOn2010,项目名称:libs,代码行数:54,代码来源:Gaming.c

示例2: getPassword

/*Player is asked to enter password. In place of the character entered by the player, asterixes are printed. The entered string is compared with set password. If the passwords match, player is granted access to the game*/
int getPassword()
{clrscr();
cleardevice();
int c=0,end=0,ch,i,j;
 char p[8];
 setcolor(7);
 setfillstyle(SOLID_FILL,BLUE);
 rectangle(10,BLUE,635,470);
 floodfill(15,60,WHITE);
 setcolor(9);
 setfillstyle(1,WHITE);
 rectangle(212,165,387,315);
 floodfill(200,200,9);
 char title[13];
 strcpy(title,"CONNECT FOUR");
 setcolor(RED);
 settextstyle(TRIPLEX_FONT,0,6);
 outtextxy(160,60,title);
 for(i=0;i<7;i++)
 for(j=0;j<6;j++)
	{setcolor(WHITE);
	setfillstyle(1,WHITE);
	fillellipse((i+1)*25+198,(j)*25+178,ray/2,ray/2);}
 for(i=1;i<=24;i++)
	{cout<<"\n";}
 for (i=1;i<=5;i++)
	{cout<<"\t";}
 setcolor (WHITE);
 setfillstyle(1,WHITE);
 bar(0,370,330,400);
 setcolor(BLACK);
 settextstyle(1,0,1);
 outtextxy(170,378,"Enter Password: ");

 ch=getch();
 while (ch!=13)
       {cout<<"*";
	p[c]=ch;
	++c;
	ch=getch();}

end=0;
if (c>8)
	end=1;
else
       {for (i=0;i<8;i++)
		{if (p[i] != password[i])
			end=1;
		}
       }

if (end==1)
	return(1);
else
	return(0);
}
开发者ID:nivasini,项目名称:Connect4,代码行数:57,代码来源:CONNECT4.CPP

示例3: newpos

void newpos(void)
{
	cleardevice();
	x=0.0;y=0.0;z=0.0;
	sx=0.0;sy=0.0;
	xa=0.0;ya=0.0;za=0.0;
	sxa=0.0;sya=0.0;sxb=0.0;syb=0.0;
	sxs=0.0;sys=0.0;
	sr1=0.0;sr2=0.0;sr3=0.0;
	cr1=0.0;cr2=0.0;cr3=0.0;
	msx=0.0;msy=0.0;
	rx=0.0;ry=0.0;
	t1=0;t2=0;
	p1=0;
	rotation();
/*	for(t2=1;t2<=6;t2++) */
	for(t2=1;t2<=4;t2++)
	{
		setlinestyle(USERBIT_LINE,0xffff,NORM_WIDTH);

		/* get starting position */
/*		x=array1[p1][0];
		y=array1[p1][1];
		z=array1[p1][2]; */
		x=array2[p1][0];
		y=array2[p1][1];
		z=array2[p1][2];
		calc_3d();
		windows();
		sxa=sx;sya=sy;

		/* finish displaying side */
/*		for(t1=1;t1<=4;t1++) */
		for(t1=1;t1<=3;t1++)
		{
			p1++;
/*			x=array1[p1][0];
			y=array1[p1][1];
			z=array1[p1][2]; */
			x=array2[p1][0];
			y=array2[p1][1];
			z=array2[p1][2];
			calc_3d();
			windows();
			sxs=sx;
			sys=sy;
			sxb=sx;
			syb=sy;
			moveto(sxa,sya);
			lineto(sxb,syb);
			sxa=sxs;
			sya=sys;
		}
		p1++;
	}
}
开发者ID:krattai,项目名称:flosh,代码行数:56,代码来源:VRTOOL.C

示例4: setvisualpage

void obj_figura::muda()
{
  if (ctela.pagina_atual == 0)
  {
    setvisualpage(1);
    ctela.pagina_atual = 1;
    setactivepage(0);
    cleardevice();
    setactivepage(1);
  }
  else
    {
      setvisualpage(0);
      ctela.pagina_atual = 0;
      setactivepage(1);
      cleardevice();
      setactivepage(0);
    }
}
开发者ID:felipelalli,项目名称:micaroni,代码行数:19,代码来源:FIGURA.CPP

示例5: f8

int f8()
{
clrscr();
cleardevice();
int flag=44;
setbkcolor(3);
draw();
char m[20];
char a[20][20]={"2xqwer4fgi","trewq9y3ry","yuip7qtgfm","jpiuy9bph6","klkjh6decc","etlhjklo2k","lasdfapl4z","efghjv5qy","mmjnhlmt8t","134rfvup5n"};
randomize();
int r=random(10)+1;
settextstyle(SCRIPT_FONT, HORIZ_DIR, 5);
outtextxy(190,0,"level 8");
line(190,60, 300, 60);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
outtextxy(0,100,"\nplease this is the last time!!!");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"\t";
for(int i=0;a[r][i]!='\0';i++)
{
 cout<<a[r][i];
 td();
 cout<<" ";
 td();
}
clrscr();
cleardevice();
draw();
settextstyle(SCRIPT_FONT, HORIZ_DIR, 5);
outtextxy(190,0,"level 8");
line(190,60, 300, 60);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
outtextxy(0,100," please type the letters you saw earlier");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"\t";
gets(m);
if(strcmpi(m,a[r])==0)

{
 flag=8;
}
else
 flag=-8;
return flag;
}
开发者ID:poornimaks,项目名称:old-projects,代码行数:43,代码来源:memory+game.cpp

示例6: f7

int f7()
{
clrscr();
cleardevice();
setbkcolor(10);
draw();
int flag=44;
char m[20];
char a[20][20]={"2x4qwfegi","rtyt9y3ry","7uipqtgfm","j9bpasdh6","kfgh6decc","etljklo2k","lzxcapl4z","ev5vbnqy","mlkmlmt8t","13iuyup5n"};
randomize();
int r=random(10)+1;
settextstyle(SCRIPT_FONT, HORIZ_DIR, 5);
outtextxy(190,0,"level 7");
line(190,60, 300, 60);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
outtextxy(0,100,"\nso far so good ");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"\t";
for(int i=0;a[r][i]!='\0';i++)
{
 cout<<a[r][i];
 td();
 cout<<" ";
 td();
}
clrscr();
cleardevice();
draw();
settextstyle(SCRIPT_FONT, HORIZ_DIR, 5);
outtextxy(190,0,"level 7");
line(190,60, 300, 60);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
outtextxy(0,100," please type the letters");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"\t";
gets(m);
if(strcmpi(m,a[r])==0)

{
 flag=7;
}
else
 flag=-7;
return flag;
}
开发者ID:poornimaks,项目名称:old-projects,代码行数:43,代码来源:memory+game.cpp

示例7: f6

int f6()
{
clrscr();
cleardevice();
setbkcolor(9);
int flag=44;
char m[20];
char a[20][20]={"2x4fgspi","tla9y3ry","bn7qtgfm","j9bph6aq","k6txdecc","eq8tlo2k","l19apl4z","xeskv5qy","mliet8tl","13up5zpn"};
randomize();
draw();
int r=random(10)+1;
settextstyle(SCRIPT_FONT, HORIZ_DIR, 5);
outtextxy(190,0,"level 6");
line(190,60, 300, 60);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
outtextxy(0,100,"\nNow it should be difficult");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"\t";
for(int i=0;a[r][i]!='\0';i++)
{
 cout<<a[r][i];
 td();
 cout<<" ";
 td();
}
clrscr();
cleardevice();
draw();
settextstyle(SCRIPT_FONT, HORIZ_DIR, 5);
outtextxy(190,0,"level 6");
line(190,60, 300, 60);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
outtextxy(0,100," please type the letters you saw earlier");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"\t";
gets(m);
if(strcmpi(m,a[r])==0)

{
 flag=6;
}
else
 flag=-6;
return flag;
}
开发者ID:poornimaks,项目名称:old-projects,代码行数:43,代码来源:memory+game.cpp

示例8: f5

int f5()
{
clrscr();
cleardevice();
setbkcolor(6);
int flag=44;
char m[20];
char a[20][20]={"2x4fg5i","ty9z3rx","7jqzgfx","j3nxph6","k6ds4rz","tv4o2bk","x7pal4z","evt5qyp","mz5xt8v","13up5nb"};
randomize();
draw();
int r=random(10)+1;
settextstyle(SCRIPT_FONT, HORIZ_DIR, 5);
outtextxy(190,0,"level 5");
line(190,60, 300, 60);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
outtextxy(0,100,"\nCOME ON AGAIN!!!!!!!");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"\t";
for(int i=0;a[r][i]!='\0';i++)
{
 cout<<a[r][i];
 td();
 cout<<" ";
 td();
}
clrscr();
cleardevice();
draw();
settextstyle(SCRIPT_FONT, HORIZ_DIR, 5);
outtextxy(190,0,"level 5");
line(190,60, 300, 60);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
outtextxy(0,100," please type the letters you saw earlier");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"\t";
gets(m);
if(strcmpi(m,a[r])==0)

{
 flag=5;
}
else
 flag=-5;
return flag;
}
开发者ID:poornimaks,项目名称:old-projects,代码行数:43,代码来源:memory+game.cpp

示例9: f4

int f4()
{
clrscr();
cleardevice();
setbkcolor(0);
int flag=44;
char m[20];
char a[20][20]={"2x4fgi","t9y3ry","7qtgfm","j3zph6","k6devc","exlo2k","zapx4z","ev5qy","5lxt8","13up5n"};
randomize();
int r=random(10)+1;
draw();
settextstyle(SCRIPT_FONT, HORIZ_DIR, 5);
outtextxy(190,0,"level 4");
line(190,60, 300, 60);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
outtextxy(0,100,"\nyou can do it again!!!");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"\t";
for(int i=0;a[r][i]!='\0';i++)
{
 cout<<a[r][i];
 td();
 cout<<" ";
 td();
}
clrscr();
cleardevice();
draw();
settextstyle(SCRIPT_FONT, HORIZ_DIR, 5);
outtextxy(190,0,"level 4");
line(190,60, 300, 60);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
outtextxy(0,100," please type the letters you saw earlier");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"\t";
gets(m);
if(strcmpi(m,a[r])==0)

{
flag=4;
}
else
flag=-4;
return flag;
}
开发者ID:poornimaks,项目名称:old-projects,代码行数:43,代码来源:memory+game.cpp

示例10: main

   int main()
   {
   int i;
    int gm;
    int gd=DETECT;
    initgraph(&gd,&gm,"");

int x=10;
int y=10;
int h=200;
int k=200;

while(1){
cleardevice();
hiosbox(x,y,h,k);



  int t=0;
   for(i=0;i<25;i++)
   {

       setcolor(i);
       hiosbox(x,y,h,k);
       if(i%5==0)t++;
       setcolor(3);
       fillellipse(x+h/3+i,y+k/6-i,h/50,k/50+t);
       barish(x,y,h,k);
       setcolor(i);
       delay(100);
   point p[4]={{x+rand()%h/6,y+rand()%k/6},{x+rand()%h/6,y+rand()%k/6},{x+rand()%h/6,y+rand()%k/6},{x+rand()%h/6,y+rand()%k/6}};
   point q[4]={{x+rand()%h/7,y+rand()%k/7},{x+rand()%h/7,y+rand()%k/7},{x+rand()%h/7,y+rand()%k/7},{x+rand()%h/7,y+rand()%k/7}};

   bezier(p);
   bezier(q);
       cleardevice();
   }
}
      getch();
      closegraph();


    }
开发者ID:haikentcode,项目名称:code,代码行数:43,代码来源:animation1.cpp

示例11: main

void main()
{   int gdriver = DETECT, gmode, errorcode;
    initgraph(&gdriver, &gmode, "c:\\turboc3\\bgi");
    intro();
    levelmenu();
    clrscr();
    cleardevice();
    setbkcolor(RED);
    easy();
}
开发者ID:noczero,项目名称:PASCAL,代码行数:10,代码来源:Shuffle+Game+project+.CPP

示例12: ComXia

void ComXia(long x,long y)
{
     long i,j;
	 move(x,y,now);
	 now = 1;
     nnx = x; nny = y;
	 cleardevice();
	 QiPan();
	 HuaNow(x,y);
}
开发者ID:babyfacebook,项目名称:FiveChess,代码行数:10,代码来源:6_18_FiveChess.cpp

示例13: displaydata

 void displaydata()
 {
	char *c;
	cleardevice();
	hidemouseptr();
	cleardevice();
	border();
	setcolor(GREEN);
	settextstyle(10,HORIZ_DIR,3);
	outtextxy(70,20,"LIST OF ACCOUNTS IN BANK");
	setcolor(LIGHTGRAY);
	line(8,95,getmaxx()-8,95);
	line(8,100,getmaxx()-8,100);
	settextstyle(1,HORIZ_DIR,1);
	outtextxy(15,120,"Acc.No.");
	outtextxy(150,120,"Name");
	outtextxy(300,120,"Address");
	outtextxy(500,120,"Balance");
 }
开发者ID:sampreeth-bekal,项目名称:ATM-simulation-,代码行数:19,代码来源:ADMIN.CPP

示例14: eraseGraphics

//End of drawLegend routine
//This routine erases the graphics already drawn
void eraseGraphics()
{
	//Erases the graphics already drawn
	cleardevice();
	//Sets fill & drawing colors
	setcolor(GREEN);
	setfillstyle(SOLID_FILL, GREEN);
	//Fills the graphics window with a green
	floodfill(0, 0, GREEN);
}
开发者ID:CodePond,项目名称:Bore-Hole-Manager,代码行数:12,代码来源:graphic_window.c

示例15: main

void main()										//Main function
{

	int gd=DETECT,gm=VGAMAX;
	float i,j,xr,xy,x,y;
	initgraph(&gd,&gm,0);
	int a[]={50,100,100,100,100,150,150,150,150,200,200,200,200,250,250,250,250,300,300,300,300,350,50,350,50,100};
	
	fillpoly(13,a);								//Draw polygon
	
	setcolor(RED);
	pieslice(75,75,0,360,25);
	xr=75;xy=75;
	delay(100);
	
	for(j=0;j<5;j++)
	{
	x=xr+25;y=xy;
	for(i=180;i<=360;i++)
	{	
		cleardevice();
		setcolor(WHITE);
		fillpoly(13,a);
		setcolor(RED);
		pieslice(x+25*cos(i*3.14/180),y+25*sin(i*3.14/180),0,360,25);
		delay(10);
		xr=x+25*cos(i*3.14/180);
		xy=y+25*sin(i*3.14/180);
	}
	for(i=0;i<50;i++)
	{	
		xy++;
		cleardevice();
		setcolor(WHITE);
		fillpoly(13,a);
		setcolor(RED);
		pieslice(xr,xy,0,360,25);
		delay(10);
	}
	}
	getch();
	closegraph();								//close graph
}
开发者ID:swathisk,项目名称:trygit,代码行数:43,代码来源:ball.c


注:本文中的cleardevice函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。