嵌入式系统课程设计报告贪吃蛇Word文档格式.docx

上传人:b****6 文档编号:16023172 上传时间:2022-11-17 格式:DOCX 页数:29 大小:21.83KB
下载 相关 举报
嵌入式系统课程设计报告贪吃蛇Word文档格式.docx_第1页
第1页 / 共29页
嵌入式系统课程设计报告贪吃蛇Word文档格式.docx_第2页
第2页 / 共29页
嵌入式系统课程设计报告贪吃蛇Word文档格式.docx_第3页
第3页 / 共29页
嵌入式系统课程设计报告贪吃蛇Word文档格式.docx_第4页
第4页 / 共29页
嵌入式系统课程设计报告贪吃蛇Word文档格式.docx_第5页
第5页 / 共29页
点击查看更多>>
下载资源
资源描述

嵌入式系统课程设计报告贪吃蛇Word文档格式.docx

《嵌入式系统课程设计报告贪吃蛇Word文档格式.docx》由会员分享,可在线阅读,更多相关《嵌入式系统课程设计报告贪吃蛇Word文档格式.docx(29页珍藏版)》请在冰豆网上搜索。

嵌入式系统课程设计报告贪吃蛇Word文档格式.docx

************************************************************************************************************

*/

#include"

..\inc\config.h"

#include<

stdlib.h>

time.h>

stdio.h>

#defineSTACKSIZE256

OS_STK_DATAstk;

externGUI_FONTCHINESE_FONT12;

externGUI_FONTCHINESE_FONT16;

externGUI_FONTGUI_Font8x16;

OS_EVENT*Key_Mbox;

/*

*************************************************************************************************************

**分配各任务的堆栈容量**

OS_STKStack_Task_1[STACKSIZE];

OS_STKStack_Task_2[STACKSIZE];

OS_STKStack_Task_3[STACKSIZE];

OS_STKStack_Task_4[STACKSIZE*3];

/************************************************************************************************************/

 

#defineMAX_X200//蛇的最大长度

#defineMAX_Y200

#defineUP1//蛇的方向

#defineDOWN2

#defineLEFT3

#defineRIGHT4

#defineROW22//表格行数

#defineCOLUMN22//表格列数

//定义蛇的各项信息

structSnake

{

S32x[MAX_X];

S32y[MAX_Y];

S32length;

S32direction;

S32life;

}snake;

structFood

{

intx;

/*食物的横坐标*/

inty;

/*食物的纵坐标*/

intyes;

/*判断是否要出现食物的变量*/

}food;

/*食物的结构体*/

S16map_1[22][22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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},//20

{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}//21

};

S16map_2[22][22]={//{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21}

{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},//0

{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//1

{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//2

{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//3

{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//4

{1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1},//5

{1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1},//6

{1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1},//7

{1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1},//8

{1,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,1},//9

{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//10

{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//11

{1,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,1},//12

{1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1},//13

{1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1},//14

{1,0,

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

当前位置:首页 > 初中教育 > 初中作文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1