跑动的圆圈
1 #include<graphics.h> 2 #include<dos.h> 3 #include<stdio.h> 4 int main() 5 { 6 int i,gdriver,gmode,j,kk; 7 void *p; 8 unsigned int size; 9 gdriver=DETECT; 10 initgraph(&gdriver,&gmode,""); 11 cleardevice(); 12 setcolor(1); 13 circle(300,200,35); 14 floodfill(300,200,1); 15 size=imagesize(270,170,330,230); 16 p=malloc(size); 17 getimage(270,170,330,230,p); 18 for(kk=0;kk<1000;kk++){ 19 for(i=0;i<50;i++) 20 { 21 cleardevice(); 22 putimage(10+i*10,200,p,0); 23 delay(22222); 24 } 25 26 for(j=0;j<50;j++) 27 { 28 cleardevice(); 29 putimage(510-j*10,200,p,0); 30 delay(22222); 31 } 32 33 } 34 free(p); 35 closegraph(); 36 return 0; 37 }
#include<graphics.h>
#include<dos.h>
#include<stdio.h>
int main()
{
int i,gdriver,gmode,j,kk=0,m=300;
void *p[12];
unsigned int size;
gdriver=DETECT;
initgraph(&gdriver,&gmode,"");
cleardevice();
for(i=0;i<2;i++){
setcolor(1);
circle(0+kk,200,35);
floodfill(m,200,1);
size=imagesize(270,170,330,230);
p[i]=malloc(size);
getimage(270,170,330,230,p[i]);
kk+640;
m+=340;
}
for(kk=0;kk<1000;kk++){
for(i=0;i<32;i++)
{
cleardevice();
putimage(10+i*10,200,p[0],0);
putimage(640-i*10,200,p[1],0);
delay(22222);
}
for(j=0;j<32 ;j++)
{
cleardevice();
putimage(320-j*10,200,p[0],0);
putimage(320+j*10,200,p[1],0)
delay(22222);
}
}
free(p);
closegraph();
return 0;
}
本文来自博客园,作者:左手边五十米,转载请注明原文链接:https://www.cnblogs.com/moomcake/p/8927024.html