snake_src.htm

来自「很小的程序 在arm上面可以运行的嵌入式的贪吃蛇游戏 网上找到的:)」· HTM 代码 · 共 751 行 · 第 1/5 页

HTM
751
字号
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>const u8 xmax</title>
</head>

<body>

<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">#include&quot;..\ucos-ii\includes.h&quot;<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</span>/* uC/OS interface */<o:p>     
</o:p>     
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">#include   
&quot;..\ucos-ii\add<a href="osaddition.h">\osaddition.h&quot;</a><o:p>
</o:p>  
</font></strong></b>
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">#include  
&lt;math.h&gt;<o:p>
</o:p> 
</font></strong></b>
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"> </p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">//设定左窗口边界&nbsp;<o:p>
</o:p>     
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">const      
u8 xmax = 40;<o:p>     
</o:p>     
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">const  
u8 xmin = 1;<o:p> 
</o:p> 
</font></strong></b>
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">const  
u8 ymax = 40;<o:p> 
</o:p> 
</font></strong></b>
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">const  
u8 ymin = 1;<o:p> 
</o:p> 
</font></strong></b>
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">&nbsp;<o:p>
</o:p>     
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">//定义各个区域豆子位置   
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">u8      
bean00[3][2] = { {2,11}, {18,13}, {15,20} };<o:p>     
</o:p>     
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">u8  
bean01[1][2] = { {10,27} };<o:p> 
</o:p> 
</font></strong></b>
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">u8  
bean10[1][2] = { {38,3} };<o:p> 
</o:p> 
</font></strong></b>
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">u8  
bean11[1][2] = { {27,38} };<o:p> 
</o:p> 
</font></strong></b>
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">&nbsp;<o:p>
</o:p>     
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">BOOLEAN      
boolbean00[3] = {TRUE, TRUE, TRUE};<o:p>     
</o:p>     
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">BOOLEAN  
boolbean01[1] = { TRUE };<o:p> 
</o:p> 
</font></strong></b>
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">BOOLEAN  
boolbean10[1] = { TRUE };<o:p> 
</o:p> 
</font></strong></b>
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">BOOLEAN  
boolbean11[1] = { TRUE };<o:p> 
</o:p> 
</font></strong></b>
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">&nbsp;<o:p>
</o:p>     
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">U8      
Length;//the length of the snake<o:p>     
</o:p>     
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">&nbsp;<o:p>
</o:p>     
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">U8      
HeadPos[2];//the position of the head of the snake<o:p>     
</o:p>     
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><b><strong><font size="2">U8      
EndPos[2]; //the position of the end<span style="mso-spacerun: yes; font-size: 10.0pt; font-family: 宋体; mso-hansi-font-family: Times New Roman; mso-font-kerning: 0pt">&nbsp; </span>of      
the snake<o:p>     
</o:p>     
</font></strong></b> 
</span></p>
<p class="MsoNormal" align="left" style="text-align: left; mso-layout-grid-align: none; text-autospace: none; word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-size:10.0pt;font-family:

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?