本文整理汇总了C++中cleardevice函数的典型用法代码示例。如果您正苦于以下问题:C++ cleardevice函数的具体用法?C++ cleardevice怎么用?C++ cleardevice使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cleardevice函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: menu
void menu()
{
int opt,style,size=2,x,y;
while(1)
{
cleardevice();
style = TRIPLEX_FONT;
/* select the text style */
settextstyle(style, HORIZ_DIR, size);
// outtext("student record project");
outtextxy(200,200," 1.new record");
setcolor(4);
outtextxy(220,220,"\n 2.modification in record");
setcolor(5);
outtextxy(240,240,"\n 3.delete record");
setcolor(6);
outtextxy(260,260,"\n 4.display");
setcolor(7);
outtextxy(280,280,"\n 8.exit");
setcolor(8);
outtextxy(300,300,"\n option ");
setcolor(9);
scanf("%d",&opt);
if(opt>7||opt<0)
break;
else
switch(opt)
{
case 1:
add();
break;
case 2:
modrec();
break;
case 4:
display();
break;
case 3:
delrec();
break;
}
getch();
return;
}
}
开发者ID:MAYURESH29,项目名称:data-structure,代码行数:55,代码来源:LOGIC3.C
示例17: main
int main (int argc, char **argv)
{
int gd, gm;
int col;
unsigned int seed;
long int counter;
float j, k, x, y, xx, xp, yp, r, xoffs, yoffs;
if (argc == 2)
seed = atoi (argv [1]); /* no checks! */
else {
printf ("Seed: ");
j = scanf ("%d", &seed);
}
srand (seed);
// random each time:
// srand (time(NULL));
gd = X11;
gm = getmaxmode ();
initgraph(&gd, &gm, "");
setbkcolor (BLACK);
cleardevice ();
setcolor (YELLOW);
outtextxy (0, 0, "Press a key or click to exit: ");
xoffs = getmaxx () / 2;
yoffs = getmaxy () / 3;
j = random (100);
k = random (100);
x = y = xx = xp = yp = r = 0.0;
col = 1; /* colours codes run from 0 (black) to 15 (white) */
counter = 0;
setcolor (col);
while (!kbhit () && !mouseclick ()) {
xx = y - sgn (x) * sqrt (abs (k * x - 1));
y = j - x;
x = xx;
xp = x * 2 + xoffs;
yp = y * 2 + yoffs;
_putpixel (xp, yp);
if (++counter == 20000) {
counter = 0;
col++;
if (col == 16)
col = 1;
}
setcolor (col);
}
closegraph ();
return 0;
}
开发者ID:romanz,项目名称:crystal-maze-3d,代码行数:55,代码来源:hopalong.c
示例18: f1
int f1()
{
clrscr();
setbkcolor(4);
cleardevice();
draw();
int flag=44;
char m[20];
char a[20][4]={"x4i","ty3","qtm","j6b","k9c","t0k","p4z","v5y","l8t","1p5"};
randomize(); //to select anyone string randomly
int r=random(10)+1;
settextstyle(SCRIPT_FONT, HORIZ_DIR, 5);
outtextxy(190,0,"level 1");
line(190,60, 300, 60);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
outtextxy(0,100,"\nNow try to remember these letters");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"\t";
for(int i=0;a[r][i]!='\0';i++) //to display letters one by one
{
cout<<a[r][i];
td();
cout<<" ";
td();
}
clrscr();
cleardevice();
draw();
settextstyle(SCRIPT_FONT, HORIZ_DIR, 5);
outtextxy(190,0,"level 1");
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) //to compare the input with the displayed string
flag=1; //if input is correct
else if(strlen(a[r])==0)
flag=101;//if nothing if accepted
else
flag=-1; //if input is incorrect
return flag;
}
开发者ID:poornimaks,项目名称:old-projects,代码行数:42,代码来源:memory+game.cpp
示例19: main
main()
{
int size;
int i=0;
int key;
int station;
InstallGraph();
setbkcolor(BLACK);
cleardevice();
setcolor(BLUE);
outtextxy(80,100,"Ready!...Any key to SET OFF!!!");
DrawGun();
getch();
cleardevice();
DrawGun();
DrawPlan();
DrawStar();
setcolor(LIGHTRED);
do
{
putimage(x0-width2,y0-height-3*width1-i,buf,XOR_PUT);
i+=2;
putimage(x0-width2,y0-height-3*width1-i,buf,XOR_PUT);
key=getch();
if(y0-height-3*width1-i==0)
outtextxy(60,100,"Successfullly!!!Press ESC to quit");
if(key==ESC)
{
if(y0-height-3*width1-i>0)
{
cleardevice();
outtextxy(100,100,"Failure.What did you do?");
outtextxy(130,130,"Press any key to quit.");
getch();
}
}
}
while(key!=ESC);
free(buf);
closegraph();
return 0;
}
开发者ID:Huericiz,项目名称:C_lg_small_examples,代码行数:42,代码来源:3-72.c
示例20: clip_poly_menu
void clip_poly_menu() {
cleardevice();
std::vector<Point2D> p1, p2;
outtext((char*)"Define the Polygon Window");
outtextxy(0, 25, (char*)"Left click mouse to add points to polygon and right click to finish adding points");
std::cout<<"\nPolygon1";
p1 = mk_poly();
cleardevice();
setcolor(RED);
mypoly(p1);
outtext((char*)"Define the Polygon to be Clipped");
std::cout<<"\nPolygon2";
p2 = mk_poly();
clip_poly(p1, p2);
}
开发者ID:rohit-95,项目名称:Graphics,代码行数:20,代码来源:menu.cpp
注:本文中的cleardevice函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论