智能交通灯c源代码.docx

上传人:b****2 文档编号:2663991 上传时间:2023-05-04 格式:DOCX 页数:65 大小:25.20KB
下载 相关 举报
智能交通灯c源代码.docx_第1页
第1页 / 共65页
智能交通灯c源代码.docx_第2页
第2页 / 共65页
智能交通灯c源代码.docx_第3页
第3页 / 共65页
智能交通灯c源代码.docx_第4页
第4页 / 共65页
智能交通灯c源代码.docx_第5页
第5页 / 共65页
智能交通灯c源代码.docx_第6页
第6页 / 共65页
智能交通灯c源代码.docx_第7页
第7页 / 共65页
智能交通灯c源代码.docx_第8页
第8页 / 共65页
智能交通灯c源代码.docx_第9页
第9页 / 共65页
智能交通灯c源代码.docx_第10页
第10页 / 共65页
智能交通灯c源代码.docx_第11页
第11页 / 共65页
智能交通灯c源代码.docx_第12页
第12页 / 共65页
智能交通灯c源代码.docx_第13页
第13页 / 共65页
智能交通灯c源代码.docx_第14页
第14页 / 共65页
智能交通灯c源代码.docx_第15页
第15页 / 共65页
智能交通灯c源代码.docx_第16页
第16页 / 共65页
智能交通灯c源代码.docx_第17页
第17页 / 共65页
智能交通灯c源代码.docx_第18页
第18页 / 共65页
智能交通灯c源代码.docx_第19页
第19页 / 共65页
智能交通灯c源代码.docx_第20页
第20页 / 共65页
亲,该文档总共65页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

智能交通灯c源代码.docx

《智能交通灯c源代码.docx》由会员分享,可在线阅读,更多相关《智能交通灯c源代码.docx(65页珍藏版)》请在冰点文库上搜索。

智能交通灯c源代码.docx

智能交通灯c源代码

智能交通灯源代码

tl.h//头文件

#include

#include

#include

#include

#include

#include

#defineLENsizeof(Car)

#defineNULL0

#definewr22

#definewg8

#definecreat_time150

#definechange_time300

#definemax_car4

typedefstructnode

{

intx,y;

intflag,flag1;

structnode*next;

}Car;

voidinitial(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);

voidarrowz(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(&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,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(300);

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);

settextstyle(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(&x,&y,&x1,&y1);

if(Button==1&&x>=180&&x<=260&&y>=355&&y<=395)

{

cleardevice();

break;

}

elseif(Button==1&&x>=390&&x<=450&&y>=355&&y<395)

{

closegraph();

}

}

}

voidcore(void)//核心函数,执行画界面,运行小车

{

void*buf[5];

graphstore(buf);

road();

light();

house();

tree();

signal();

runcar(buf);

}

voidgoodbye(void)//再见界面函数

{

inti;

intButton=0,x=-20,y=-10,x1=-20,y1=-10;

charxie[]={

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0xC0,0x00,0x02,0x00,

0x03,0x80,0x00,0x00,0xC0,0x00,0x07,0x00,

0x03,0xC0,0x00,0x01,0x80,0x00,0x07,0x00,

0x01,0xE0,0x00,0x01,0x80,0x00,0x07,0x00,

0x00,0x70,0x00,0x03,0x00,0x00,0x07,0x00,

0x00,0x38,0x00,0x07,0x00,0x00,0x07,0x00,

0x00,0x1C,0x00,0x06,0x00,0x00,0x07,0x00,

0x00,0x0E,0x00,0xFF,0xFC,0x00,0x07,0x00,

0x00,0x07,0x01,0xFF,0xFE,0x00,0x07,0x00,

0x00,0x03,0x01,0xC0,0x0E,0x1F,0xFF,0xF8,

0x00,0x00,0x03,0x80,0x07,0x1F,0xFF,0xF8,

0x00,0x00,0x03,0x80,0x07,0x00,0x07,0x00,

0x00,0x00,0x03,0x80,0x07,0x00,0x07,0x00,

0x00,0x00,0x03,0x80,0x07,0x00,0x07,0x00,

0x00,0x00,0x03,0x80,0x07,0x00,0x07,0x00,

0x00,0x00,0x03,0x80,0x07,0x00,0x07,0x00,

0x00,0x00,0x03,0xFF,0xFF,0x00,0x07,0x00,

0x00,0x00,0x03,0xFF,0xFF,0x00,0x07,0x00,

0x3F,0xE0,0x03,0x80,0x07,0x00,0x07,0x00,

0x3F,0xF0,0x03,0x80,0x07,0x0C,0x07,0x00,

0x00,0x70,0x03,0x80,0x07,0x0C,0x07,0x00,

0x00,0x38,0x03,0x80,0x07,0x0C,0x07,0x00,

0x00,0x38,0x03,0x80,0x07,0x0E,0x07,0x00,

0x00,0x38,0x03,0x80,0x07,0x06,0x07,0x00,

0x00,0x38,0x03,0x80,0x07,0x06,0x07,0x00,

0x00,0x38,0x03,0xFF,0xFF,0x06,0x07,0x00,

0x00,0x38,0x03,0xFF,0xFF,0x07,0x07,0x00,

0x00,0x38,0x03,0x80,0x07,0x03,0x07,0x00,

0x00,0x38,0x03,0x80,0x07,0x03,0x07,0x00,

0x00,0x38,0x03,0x80,0x07,0x03,0x07,0x00,

0x00,0x38,0x03,0x80,0x07,0x03,0x87,0x00,

0x00,0x38,0x03,0x80,0x07,0x03,0x87,0x00,

0x00,0x38,0x03,0x80,0x07,0x01,0x87,0x00,

0x00,0x38,0x03,0x80,0x07,0x01,0x87,0x00,

0x00,0x38,0x03,0x83,0xFF,0x01,0x87,0x00,

0x00,0x38,0x1F,0xFF,0xFF,0x01,0x87,0x00,

0x00,0x38,0x1F,0xF8,0x07,0x01,0xC7,0x00,

0x00,0x38,0x10,0x00,0x0F,0x01,0xC7,0x00,

0x00,0x38,0x00,0x00,0x0F,0x00,0xC7,0x00,

0x00,0x38,0x00,0x00,0x1F,0x00,0xC7,0x00,

0x00,0x38,0x00,0x00,0x37,0x00,0xC7,0x00,

0x00,0x38,0x00,0x00,0x67,0x00,0x07,0x00,

0x00,0x38,0x00,0x00,0xE7,0x00,0x07,0x00,

0x00,0x38,0x18,0x01,0xC7,0x00,0x07,0x00,

0x00,0x38,0x18,0x03,0x87,0x00,0x07,0x00,

0x00,0x38,0x30,0x07,0x07,0x00,0x07,0x00,

0x00,0x38,0x70,0x0E,0x07,0x00,0x07,0x00,

0x00,0x38,0xE0,0x3C,0x07,0x00,0x07,0x00,

0x00,0x38,0xC0,0x70,0x07,0x00,0x07,0x00,

0x00,0x39,0x80,0xE0,0x07,0x00,0x07,0x00,

0x00,0x3F,0x03,0xC0,0x07,0x00,0x07,0x00,

0x00,0x3E,0x07,0x80,0x07,0x00,0x07,0x00,

0x00,0x1C,0x1E,0x00,0x07,0x00,0x07,0x00,

0x00,0x18,0x1C,0x00,0x07,0x00,0x07,0x00,

0x00,0x00,0x00,0x1F,0x0E,0x0E,0x07,0x00,

0x00,0x00,0x00,0x1F,0xFE,0x0F,0xFE,0x00,

0x00,0x00,0x00,0x01,0xF8,0x03,0xFC,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

charzhi[]={

0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,

0x00,0x08,0x01,0x80,0x00,0x0C,0x00,0x80,

0x00,0x04,0x00,0x80,0x00,0x04,0x00,0x80,

0x00,0xC7,0x00,0x80,0x00,0xCF,0xA1,0x80,

0x00,0xFE,0x11,0x80,0x00,0xFC,0x19,0x80,

0x00,0x7D,0x89,0x80,0x00,0x0F,0xC9,0x80,

0x00,0x1E,0x09,0x80,0x00,0x78,0x09,0x80,

0x00,0xC3,0x08,0x80,0x03,0x07,0x98,0x80,

0x0E,0x0C,0x88,0x80,0x78,0x9C,0xC0,0x80,

0x30,0xEC,0x80,0x80,0x00,0xCC,0x80,0x80,

0x00,0xCC,0x80,0x80,0x01,0x8D,0x80,0x80,

0x01,0x8D,0x80,0x80,0x00,0x8C,0x00,0x80,

0x00,0x04,0x00,0x80,0x00,0x04,0x07,0xC0,

0x00,0x00,0x03,0xC0,0x00,0x00,0x01,0xC0,

0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

charzuo[]={

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0xC0,0x00,0x00,0x70,0xE3,0x00,

0x00,0x70,0xEF,0x00,0x00,0x79,0xFE,0x00,

0x00,0xF1,0xF8,0x00,0x00,0xE3,0xF0,0x00,

0x01,0xC3,0xB0,0x00,0x01,0xC3,0x30,0x00,

0x03,0x80,0x30,0x00,0x07,0x80,0x3E,0x00,

0x03,0xC0,0x23,0x00,0x00,0x60,0x22,0x00,

0x00,0x60,0x22,0x00,0x00,0x60,0x24,0x00,

0x00,0x60,0x27,0x00,0x00,0xE0,0x27,0x80,

0x00,0xE0,0x27,0x80,0x00,0x60,0x20,0x80,

0x00,0x60,0x20,0x00,0x00,0x00,0x20,0x00,

0x00,0x00,0x30,0x00,0x00,0x00,0x10,0x00,

0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

charren[]={

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,

0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x00,

0x00,0x0E,0x00,0x00,0x00,0x1C,0x00,0x00,

0x00,0x38,0x00,0x00,0x00,0x38,0x00,0x00,

0x00,0x7E,0x00,0x00,0x00,0x43,0xC0,0x00,

0x00,0xC0,0x60,0x00,0x00,0x80,0x38,0x00,

0x01,0x00,0x1E,0x00,0x03,0x00,0x0F,0x80,

0x02,0x00,0x07,0xF0,0x0E,0x00,0x03,0xFC,

0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

charl[]={

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x20,0x00,0x00,0x00,0x60,0x00,0x00,

0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,

0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

charlin[]={

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,

0x00,0x00,0x04,0x00,0x00,0x08,0x06,0x00,

0x00,0x18,0x06,0x00,0x00,0x18,0x04,0x00,

0x00,0x18,0x05,0xC0,0x00,0x1C,0x07,0xC0,

0x00,0x38,0x07,0x00,0x00,0xF8,0x1C,0x00,

0x01,0xF8,0x7C,0x00,0x0F,0xD9,0xFC,0x00,

0x07,0x1A,0x30,0x00,0x02,0x1C,0x30,0x00,

0x00,0x38,0x3C,0x00,0x00,0x30,0x7F,0x00,

0x00,0x70,0x43,0xC0,0x01,0xF0,0x80,0x70,

0x01,0xF1,0x00,0x38,0x01,0x90,0x00,0x0C,

0x01,0x90,0x00,0x04,0x00,0x30,0x00,0x00,

0x00,0x10,0x3C,0x00,0x00,0x10,0x0C,0x00,

0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

charchen[]={

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x40,0x00,0x00,0x00,0x60,0x18,0x00,

0x00,0x60,0x18,0x00,0x00,0x60,0x18,0x00,

0x00,0x40,0x18,0x00,0x00,0x40,0x19,0x80,

0x00,0xF0,0x11,0xC0,0x04,0x41,0xE3,0x80,

0x06,0x41,0xE7,0x00,0x0E,0x03,0xEE,0x00,

0x0C,0x07,0x48,0x00,0x1C,0x02,0x5C,0x00,

0x18,0x00,0xC8,0x00,0x08,0x00,0x88,0x00,

0x00,0x01,0x90,0x00,0x00,0x41,0x10,0x00,

0x00,0xC2,0x00,0x08,0x00,0xC0,0x20,0x08,

0x00,0xC0,0x10,0x08,0x00,0xC0,0x0F,0xF8,

0x00,0x40,0x00,0xE0,0x00,0x40,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

charzhao[]={

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x10,0x00,0x00,0x00,0x18,0x00,0x00,

0x00,0x1C,0x00,0x00,0x00,0x1C,0x00,0x00,

0x00,0x1E,0x04,0x00,0x00,0x1E,0x03,0x00,

0x00,0xF8,0x0

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 党团工作 > 入党转正申请

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2