snake_transmit_task.htm

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

HTM
818
字号
</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"><b><strong><font size="2"><span lang="EN-US" style="font-size:10.0pt;font-family:
宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt"><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; 
</span>//</span><span style="font-size:10.0pt;
font-family:宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt;
mso-ansi-language:ZH-CN">判断</span><span lang="EN-US" style="font-size:10.0pt;
font-family:宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt">snake</span><span style="font-size:10.0pt;font-family:宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;
mso-font-kerning:0pt;mso-ansi-language:ZH-CN">头部的变化</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;
mso-font-kerning:0pt"><o:p>
</o:p>
</span></font></strong></b></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"><span style="mso-tab-count:1"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong>switch (HeadDirect)<o:p>   
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:2"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong>{<o:p>
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:2"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span>case 1:<o:p>   
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:3"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span>HeadPos[0] =    
HeadPos[0] + 1;<o:p>   
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:3"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span>break;<o:p>
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:2"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span>case 2:<o:p>   
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:3"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span>HeadPos[0] =    
HeadPos[0] - 1;<o:p>   
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:3"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span>break;<o:p>
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:2"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span>case 3:<o:p>   
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:3"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span>HeadPos[1] =    
HeadPos[1] - 1;<o:p>   
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:3"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span>break;<o:p>
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:2"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span>case 4:<o:p>   
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:3"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span>HeadPos[1] =    
HeadPos[1] + 1;<o:p>   
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:3"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span>break;<o:p>
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:2"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong>}<o:p>
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:1"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><strong><b>//</b></strong></font></span><font size="2"><b><strong><span style="font-size:10.0pt;
font-family:宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt;
mso-ansi-language:ZH-CN">判断</span><span lang="EN-US" style="font-size:10.0pt;
font-family:宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:0pt">snake</span><span style="font-size:10.0pt;font-family:宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;
mso-font-kerning:0pt;mso-ansi-language:ZH-CN">尾部的变化</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-hansi-font-family:&quot;Times New Roman&quot;;
mso-font-kerning:0pt"><o:p>
</o:p>
</span></strong></b></font></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"><span style="mso-tab-count:1"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;  
</strong></b></font>  
</span><font size="2"><b><strong><o:p>
</o:p>  
</strong></b></font> 
</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"><span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; 
</span>if (ChangePointCount &gt; 0)<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"><span style="mso-tab-count:1"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong>{<o:p>
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:1"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-spacerun: yes">&nbsp; </span>if ( (    
abs(ChangePointPos[ChangePointCount-1][0]-EndPos[0])+abs(ChangePointPos[ChangePointCount-1][1]-EndPos[1]))    
== 0)<o:p>   
</o:p>   
</strong></b></font> 
</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"><span style="mso-tab-count:2"><font size="2"><b><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
</strong></b></font> 
</span><font size="2"><b><strong><span style="mso-spacerun: yes">&nbsp; </span>{<o:p>

⌨️ 快捷键说明

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