资源描述:
《智能交通灯c源代码》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、智能交通灯源代码tl.h//头文件#include#include#include#include#include#include#defineLENsizeof(Car)#defineNULL0#definewr22#definewg8#definecreat_time150#definechange_time300#definemax_car4typedefstructnode{intx,y;intflag,flag1;structnode*next;}Car;voidini
2、tial(void);voidwelcome(void);voidcore(void);voidgoodbye(void);voidend(void);voiddrawcar(intx,inty,intflag);voidgraphstore(void*buffer[]);voidshift(intflag,int*car1,int*car2,int*car3,int*car4,int*car5,intx,inty);voidtriangle(inta,intb,intc,intd,inte,intf,intg,inth);voidarrowx(intx,inty,intcolor);vo
3、idarrowz(intx,inty,intcolor);voidarrows(intx,inty,intcolor);voidarrowy(intx,inty,intcolor);voiddraw_tree(intx,inty);voiddraw_house(intx,inty);voiddrawline(void);voidroad(void);voidlight(void);voidtree(void);voidhouse(void);voidclear(void);voidinitial(void)//初始化图形{intgdriver=DETECT,gmode;initgraph(
4、&gdriver,&gmode,"");cleardevice();}voidwelcome(void)//欢迎界面的函数{inti;intButton=0,x=-20,y=-10,x1=-20,y1=-10;setbkcolor(BLUE);setfillstyle(1,DARKGRAY);bar(getmaxx()/2-200,300,getmaxx()/2+200,450);setcolor(GREEN);setfillstyle(1,GREEN);pieslice(getmaxx()/2-100,375,0,360,60);setcolor(RED);settextstyle(1,
5、0,4);outtextxy(getmaxx()/2-140,355,"Enter");setfillstyle(1,RED);pieslice(getmaxx()/2+100,375,0,360,60);setcolor(GREEN);settextstyle(1,0,4);outtextxy(getmaxx()/2+70,355,"Exit");for(i=1;i<=8;i++){setwritemode(XOR_PUT);setcolor(MAGENTA);settextstyle(1,0,i);outtextxy(50+23*i,10+4*i,"Welcome");delay(30
6、0);settextstyle(1,0,i);outtextxy(50+23*i,10+4*i,"Welcome");}setwritemode(COPY_PUT);setcolor(YELLOW);settextstyle(1,0,9);outtextxy(130,40,"Welcome");for(i=1;i<=5;i++){setwritemode(XOR_PUT);setcolor(MAGENTA);settextstyle(1,0,i);outtextxy(190-19*i,275-7*i,"toourintellgenttraffic");delay(300);settexts
7、tyle(1,0,i);outtextxy(190-19*i,275-7*i,"toourintellgenttraffic");}setwritemode(COPY_PUT);setcolor(YELLOW);settextstyle(1,0,6);outtextxy(10,200,"toourintellgenttraffic");while(1){mouse(3,&Button,&x,&y);draw_mouse(