【C++】 C++游戏设计---五子棋小游戏

devtools/2024/11/14 5:29:37/
class="tags" href="/C.html" title=c>cle class="tags" href="/C.html" title=c>class="baidu_pl">
class="tags" href="/C.html" title=c>cle_class="tags" href="/C.html" title=c>content" class="tags" href="/C.html" title=c>class="articlass="tags" href="/C.html" title=c>cle_class="tags" href="/C.html" title=c>content class="tags" href="/C.html" title=c>clearfix">
class="tags" href="/C.html" title=c>content_views" class="tags" href="/C.html" title=c>class="markdown_views prism-atom-one-light">class="tags" href="/C.html" title=c>cap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-bloclass="tags" href="/C.html" title=c>ck" style="-webkit-tap-highlight-class="tags" href="/C.html" title=c>color: rgba(0, 0, 0, 0);">

1. 游戏介绍

一个简单的 C++ 五子棋小游戏

1.1 游戏规则:
  • 双人轮流输入下入点坐标
  • 横竖撇捺先成五子连线者胜
  • 同一坐标点不允许重复输入
1.2 初始化与游戏界面
  • 初始化界面
  • class="tags" href="/C.html" title=c>c="https://i-blog.class="tags" href="/C.html" title=c>csdnimg.class="tags" href="/C.html" title=c>cn/direclass="tags" href="/C.html" title=c>ct/6aa12496686441f3920class="tags" href="/C.html" title=c>ca9f87e549ab4.png" alt="在这里插入图片描述" />
  • X 输入坐标后
  • class="tags" href="/C.html" title=c>c="https://i-blog.class="tags" href="/C.html" title=c>csdnimg.class="tags" href="/C.html" title=c>cn/direclass="tags" href="/C.html" title=c>ct/2521932e75f34bclass="tags" href="/C.html" title=c>c7a008ea70f9d05aa4.png" alt="在这里插入图片描述" />
  • O 输入坐标后
  • class="tags" href="/C.html" title=c>c="https://i-blog.class="tags" href="/C.html" title=c>csdnimg.class="tags" href="/C.html" title=c>cn/direclass="tags" href="/C.html" title=c>ct/ad5class="tags" href="/C.html" title=c>c93de20ff430480845369753289d5.png" alt="在这里插入图片描述" />
  • X 先达到胜出条件

class="tags" href="/C.html" title=c>c="https://i-blog.class="tags" href="/C.html" title=c>csdnimg.class="tags" href="/C.html" title=c>cn/direclass="tags" href="/C.html" title=c>ct/class="tags" href="/C.html" title=c>cef597class="tags" href="/C.html" title=c>cb7b0b47f5b7670070680b765d.png" alt="在这里插入图片描述" />

2. 源代码

<class="tags" href="/C.html" title=c>code class="tags" href="/C.html" title=c>class="prism language-class="tags" href="/C.html" title=c>cpp">class="tags" href="/C.html" title=c>class="token maclass="tags" href="/C.html" title=c>cro property">class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive-hash">#class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive keyword">inclass="tags" href="/C.html" title=c>clude class="tags" href="/C.html" title=c>class="token string"><iostream>
class="tags" href="/C.html" title=c>class="token maclass="tags" href="/C.html" title=c>cro property">class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive-hash">#class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive keyword">inclass="tags" href="/C.html" title=c>clude class="tags" href="/C.html" title=c>class="token string"><veclass="tags" href="/C.html" title=c>ctor>
class="tags" href="/C.html" title=c>class="token maclass="tags" href="/C.html" title=c>cro property">class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive-hash">#class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive keyword">inclass="tags" href="/C.html" title=c>clude class="tags" href="/C.html" title=c>class="token string"><algorithm>
class="tags" href="/C.html" title=c>class="token maclass="tags" href="/C.html" title=c>cro property">class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive-hash">#class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive keyword">inclass="tags" href="/C.html" title=c>clude class="tags" href="/C.html" title=c>class="token string"><limits>class="tags" href="/C.html" title=c>class="token keyword">using class="tags" href="/C.html" title=c>class="token keyword">namespaclass="tags" href="/C.html" title=c>ce stdclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">class="tags" href="/C.html" title=c>const class="tags" href="/C.html" title=c>class="token keyword">int BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">15class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;
class="tags" href="/C.html" title=c>class="token keyword">class="tags" href="/C.html" title=c>char boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">void class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">initBoardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int j class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; j class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++jclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[jclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token string">'.'class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">void class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">printBoardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int j class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; j class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++jclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>cout class="tags" href="/C.html" title=c>class="token operator"><< boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[jclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator"><< class="tags" href="/C.html" title=c>class="token string">" "class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>cout class="tags" href="/C.html" title=c>class="token operator"><< endlclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">bool class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">isBoardFullclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int j class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; j class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++jclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[jclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">== class="tags" href="/C.html" title=c>class="token string">'.'class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">falseclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">bool class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckWinclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">int yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">class="tags" href="/C.html" title=c>char playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">int class="tags" href="/C.html" title=c>countclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 横向检查class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">maxclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, x class="tags" href="/C.html" title=c>class="token operator">- class="tags" href="/C.html" title=c>class="token number">4class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator"><= xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">== playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>countclass="tags" href="/C.html" title=c>class="token operator">++class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= x class="tags" href="/C.html" title=c>class="token operator">+ class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator">< class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">minclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, x class="tags" href="/C.html" title=c>class="token operator">+ class="tags" href="/C.html" title=c>class="token number">5class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">== playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>countclass="tags" href="/C.html" title=c>class="token operator">++class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">breakclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">5class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 纵向检查class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">maxclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, y class="tags" href="/C.html" title=c>class="token operator">- class="tags" href="/C.html" title=c>class="token number">4class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator"><= yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">== playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>countclass="tags" href="/C.html" title=c>class="token operator">++class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= y class="tags" href="/C.html" title=c>class="token operator">+ class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator">< class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">minclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, y class="tags" href="/C.html" title=c>class="token operator">+ class="tags" href="/C.html" title=c>class="token number">5class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">== playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>countclass="tags" href="/C.html" title=c>class="token operator">++class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">breakclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">5class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 斜向(从左上到右下)检查class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">maxclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">4class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator"><= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(x class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">&& x class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">&& y class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">&& y class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">&& boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[y class="tags" href="/C.html" title=c>class="token operator">+ iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[x class="tags" href="/C.html" title=c>class="token operator">+ iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">== playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>countclass="tags" href="/C.html" title=c>class="token operator">++class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator"><= class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">minclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token number">4class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">- class="tags" href="/C.html" title=c>class="token number">1 class="tags" href="/C.html" title=c>class="token operator">- xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(x class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">&& x class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">&& y class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">&& y class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">&& boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[y class="tags" href="/C.html" title=c>class="token operator">+ iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[x class="tags" href="/C.html" title=c>class="token operator">+ iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">== playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>countclass="tags" href="/C.html" title=c>class="token operator">++class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">breakclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">5class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 斜向(从右上到左下)检查class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">maxclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">4class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator"><= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(x class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">&& x class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">&& y class="tags" href="/C.html" title=c>class="token operator">- i class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">&& y class="tags" href="/C.html" title=c>class="token operator">- i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">&& boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[y class="tags" href="/C.html" title=c>class="token operator">- iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[x class="tags" href="/C.html" title=c>class="token operator">+ iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">== playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>countclass="tags" href="/C.html" title=c>class="token operator">++class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator"><= class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">minclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token number">4class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">- class="tags" href="/C.html" title=c>class="token number">1 class="tags" href="/C.html" title=c>class="token operator">- xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(x class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">&& x class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">&& y class="tags" href="/C.html" title=c>class="token operator">- i class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">&& y class="tags" href="/C.html" title=c>class="token operator">- i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">&& boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[y class="tags" href="/C.html" title=c>class="token operator">- iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[x class="tags" href="/C.html" title=c>class="token operator">+ iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">== playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>countclass="tags" href="/C.html" title=c>class="token operator">++class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">breakclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">5class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">falseclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">int class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">mainclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">initBoardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">bool isPlayerX class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">bool gameOver class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token boolean">falseclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">while class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token operator">!gameOverclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">printBoardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">int xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>cout class="tags" href="/C.html" title=c>class="token operator"><< class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(isPlayerX class="tags" href="/C.html" title=c>class="token operator">? class="tags" href="/C.html" title=c>class="token string">"Player X" class="tags" href="/C.html" title=c>class="token operator">: class="tags" href="/C.html" title=c>class="token string">"Player O"class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator"><< class="tags" href="/C.html" title=c>class="token string">", enter your move (row class="tags" href="/C.html" title=c>column): "class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>cin class="tags" href="/C.html" title=c>class="token operator">>> y class="tags" href="/C.html" title=c>class="token operator">>> xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(x class="tags" href="/C.html" title=c>class="token operator">< class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">|| x class="tags" href="/C.html" title=c>class="token operator">>= BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">|| y class="tags" href="/C.html" title=c>class="token operator">< class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">|| y class="tags" href="/C.html" title=c>class="token operator">>= BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">|| boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">!= class="tags" href="/C.html" title=c>class="token string">'.'class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>cout class="tags" href="/C.html" title=c>class="token operator"><< class="tags" href="/C.html" title=c>class="token string">"Invalid move. Try again." class="tags" href="/C.html" title=c>class="token operator"><< endlclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">class="tags" href="/C.html" title=c>continueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">= isPlayerX class="tags" href="/C.html" title=c>class="token operator">? class="tags" href="/C.html" title=c>class="token string">'X' class="tags" href="/C.html" title=c>class="token operator">: class="tags" href="/C.html" title=c>class="token string">'O'class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckWinclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">printBoardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>cout class="tags" href="/C.html" title=c>class="token operator"><< class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(isPlayerX class="tags" href="/C.html" title=c>class="token operator">? class="tags" href="/C.html" title=c>class="token string">"Player X wins!" class="tags" href="/C.html" title=c>class="token operator">: class="tags" href="/C.html" title=c>class="token string">"Player O wins!"class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator"><< endlclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;gameOver class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">isBoardFullclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">printBoardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>cout class="tags" href="/C.html" title=c>class="token operator"><< class="tags" href="/C.html" title=c>class="token string">"It's a draw!" class="tags" href="/C.html" title=c>class="token operator"><< endlclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;gameOver class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{isPlayerX class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token operator">!isPlayerXclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>code>

3. 主要代码释解

这段代码是一个简单的五子棋游戏的实现࿰class="tags" href="/C.html" title=c>c;下面是对主要函数和异常错误处理机制的详解:

  1. <class="tags" href="/C.html" title=c>code>initBoard()class="tags" href="/C.html" title=c>code>
    • 功能:初始化棋盘࿰class="tags" href="/C.html" title=c>c;将所有位置设置为’.'࿰class="tags" href="/C.html" title=c>c;表示空白。
    • 实现:通过双重循环遍历二维数组<class="tags" href="/C.html" title=c>code>boardclass="tags" href="/C.html" title=c>code>࿰class="tags" href="/C.html" title=c>c;并将每个元素设置为’.'。
  2. <class="tags" href="/C.html" title=c>code>printBoard()class="tags" href="/C.html" title=c>code>
    • 功能:打印当前棋盘的状态。
    • 实现:通过双重循环遍历二维数组<class="tags" href="/C.html" title=c>code>boardclass="tags" href="/C.html" title=c>code>࿰class="tags" href="/C.html" title=c>c;并打印每个元素。
  3. <class="tags" href="/C.html" title=c>code>isBoardFull()class="tags" href="/C.html" title=c>code>
    • 功能:检查棋盘是否已满。
    • 实现:通过双重循环遍历二维数组<class="tags" href="/C.html" title=c>code>boardclass="tags" href="/C.html" title=c>code>࿰class="tags" href="/C.html" title=c>c;如果所有位置都不是’.'࿰class="tags" href="/C.html" title=c>c;则返回<class="tags" href="/C.html" title=c>code>trueclass="tags" href="/C.html" title=c>code>࿰class="tags" href="/C.html" title=c>c;表示棋盘已满。
  4. <class="tags" href="/C.html" title=c>code>class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckWin(int x, int y, class="tags" href="/C.html" title=c>char player)class="tags" href="/C.html" title=c>code>
    • 功能:检查给定玩家是否在(x, y)位置获胜。
    • 实现:检查横向、纵向、两个对角线方向是否有连续的 5 个相同的棋子。如果找到࿰class="tags" href="/C.html" title=c>c;则返回<class="tags" href="/C.html" title=c>code>trueclass="tags" href="/C.html" title=c>code>࿰class="tags" href="/C.html" title=c>c;表示该玩家获胜。
  5. <class="tags" href="/C.html" title=c>code>main()class="tags" href="/C.html" title=c>code>
    • 功能:游戏的主循环࿰class="tags" href="/C.html" title=c>c;处理玩家的输入࿰class="tags" href="/C.html" title=c>c;更新棋盘状态࿰class="tags" href="/C.html" title=c>c;并判断游戏是否结束。
    • 实现
      • 初始化棋盘。
      • 在一个循环中交替让两个玩家输入他们的移动。
      • 检查移动是否有效(即在棋盘范围内且位置为空)。
      • 更新棋盘࿰class="tags" href="/C.html" title=c>c;并检查是否有玩家获胜或棋盘已满。

4. 异常和错误处理机制

  1. 输入有效性检查
    • 在<class="tags" href="/C.html" title=c>code>main()class="tags" href="/C.html" title=c>code>函数中࿰class="tags" href="/C.html" title=c>c;玩家输入移动后࿰class="tags" href="/C.html" title=c>c;代码检查移动是否在棋盘范围内࿰class="tags" href="/C.html" title=c>c;以及对应位置是否为空。
    • 如果移动无效(即<class="tags" href="/C.html" title=c>code>xclass="tags" href="/C.html" title=c>code>或<class="tags" href="/C.html" title=c>code>yclass="tags" href="/C.html" title=c>code>超出范围࿰class="tags" href="/C.html" title=c>c;或者对应位置不是’.')࿰class="tags" href="/C.html" title=c>c;则打印错误消息࿰class="tags" href="/C.html" title=c>c;并通过<class="tags" href="/C.html" title=c>code>class="tags" href="/C.html" title=c>continueclass="tags" href="/C.html" title=c>code>跳过当前循环的剩余部分࿰class="tags" href="/C.html" title=c>c;提示玩家重新输入。
  2. 棋盘满时结束游戏
    • 在玩家每次移动后࿰class="tags" href="/C.html" title=c>c;调用<class="tags" href="/C.html" title=c>code>isBoardFull()class="tags" href="/C.html" title=c>code>检查棋盘是否已满。
    • 如果棋盘已满࿰class="tags" href="/C.html" title=c>c;则打印平局消息࿰class="tags" href="/C.html" title=c>c;并通过设置<class="tags" href="/C.html" title=c>code>gameOverclass="tags" href="/C.html" title=c>code>为<class="tags" href="/C.html" title=c>code>trueclass="tags" href="/C.html" title=c>code>结束游戏。
  3. 检查获胜条件
    • 在玩家每次移动后࿰class="tags" href="/C.html" title=c>c;调用<class="tags" href="/C.html" title=c>code>class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckWin()class="tags" href="/C.html" title=c>code>检查该玩家是否获胜。
    • 如果玩家获胜࿰class="tags" href="/C.html" title=c>c;则打印获胜消息࿰class="tags" href="/C.html" title=c>c;并通过设置<class="tags" href="/C.html" title=c>code>gameOverclass="tags" href="/C.html" title=c>code>为<class="tags" href="/C.html" title=c>code>trueclass="tags" href="/C.html" title=c>code>结束游戏。

5. 可改进点

  • 异常处理:代码中没有使用 C++ 的异常处理机制࿰class="tags" href="/C.html" title=c>c;例如<class="tags" href="/C.html" title=c>code>try-class="tags" href="/C.html" title=c>catclass="tags" href="/C.html" title=c>chclass="tags" href="/C.html" title=c>code>块。在某些情况下࿰class="tags" href="/C.html" title=c>c;如果输入不是整数࿰class="tags" href="/C.html" title=c>c;<class="tags" href="/C.html" title=c>code>class="tags" href="/C.html" title=c>cinclass="tags" href="/C.html" title=c>code>会进入错误状态࿰class="tags" href="/C.html" title=c>c;这可能导致无限循环。可以通过检查<class="tags" href="/C.html" title=c>code>class="tags" href="/C.html" title=c>cinclass="tags" href="/C.html" title=c>code>的状态并清除错误标志来处理这种情况。
  • 边界条件检查:在<class="tags" href="/C.html" title=c>code>class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckWin()class="tags" href="/C.html" title=c>code>函数中࿰class="tags" href="/C.html" title=c>c;对斜向检查的边界条件处理可以进一步优化࿰class="tags" href="/C.html" title=c>c;以避免不必要的条件判断。
  • 代码重用:<class="tags" href="/C.html" title=c>code>class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckWin()class="tags" href="/C.html" title=c>code>函数中的横向、纵向和斜向检查有大量重复代码࿰class="tags" href="/C.html" title=c>c;可以通过提取重复代码到单独的函数中来简化。

这个游戏实现简单࿰class="tags" href="/C.html" title=c>c;但包含了基本的游戏逻辑和错误处理机制࿰class="tags" href="/C.html" title=c>c;适合作为学习<class="tags" href="/C.html" title=c>code>C++class="tags" href="/C.html" title=c>code>和游戏编程的入门项目。



6. 追更

  • 6.1 优化了判胜代码
<class="tags" href="/C.html" title=c>code class="tags" href="/C.html" title=c>class="prism language-class="tags" href="/C.html" title=c>cpp">class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 检查给定玩家是否在(x, y)位置沿一个方向获胜
class="tags" href="/C.html" title=c>class="token keyword">bool class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">int yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">int dxclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">int dyclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">class="tags" href="/C.html" title=c>char playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">int class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator">< class="tags" href="/C.html" title=c>class="token number">5class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">int class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckX class="tags" href="/C.html" title=c>class="token operator">= x class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">* dxclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">int class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckY class="tags" href="/C.html" title=c>class="token operator">= y class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">* dyclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckX class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">&& class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckX class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">&& class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckY class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">&& class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckY class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">&& boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckYclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckXclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">== playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>countclass="tags" href="/C.html" title=c>class="token operator">++class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">breakclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">== class="tags" href="/C.html" title=c>class="token number">5class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 检查给定玩家是否在(x, y)位置获胜
class="tags" href="/C.html" title=c>class="token keyword">bool class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckWinclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">int yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">class="tags" href="/C.html" title=c>char playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 检查水平方向class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator">|| class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 检查垂直方向class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator">|| class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 检查两个斜线方向class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator">|| class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator">|| class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">falseclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}
class="tags" href="/C.html" title=c>code>
6.2 完整代码
  • class="tags" href="/C.html" title=c>catclass="tags" href="/C.html" title=c>ch_254">优化了判胜代码并增加了<class="tags" href="/C.html" title=c>code>try-class="tags" href="/C.html" title=c>catclass="tags" href="/C.html" title=c>chclass="tags" href="/C.html" title=c>code>块捕获异常࿰class="tags" href="/C.html" title=c>c;仅供参考
<class="tags" href="/C.html" title=c>code class="tags" href="/C.html" title=c>class="prism language-class="tags" href="/C.html" title=c>cpp">class="tags" href="/C.html" title=c>class="token maclass="tags" href="/C.html" title=c>cro property">class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive-hash">#class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive keyword">inclass="tags" href="/C.html" title=c>clude class="tags" href="/C.html" title=c>class="token string"><iostream>
class="tags" href="/C.html" title=c>class="token maclass="tags" href="/C.html" title=c>cro property">class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive-hash">#class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive keyword">inclass="tags" href="/C.html" title=c>clude class="tags" href="/C.html" title=c>class="token string"><veclass="tags" href="/C.html" title=c>ctor>
class="tags" href="/C.html" title=c>class="token maclass="tags" href="/C.html" title=c>cro property">class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive-hash">#class="tags" href="/C.html" title=c>class="token direclass="tags" href="/C.html" title=c>ctive keyword">inclass="tags" href="/C.html" title=c>clude class="tags" href="/C.html" title=c>class="token string"><limits>class="tags" href="/C.html" title=c>class="token keyword">using class="tags" href="/C.html" title=c>class="token keyword">namespaclass="tags" href="/C.html" title=c>ce stdclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">class="tags" href="/C.html" title=c>const class="tags" href="/C.html" title=c>class="token keyword">int BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">15class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;
class="tags" href="/C.html" title=c>class="token keyword">class="tags" href="/C.html" title=c>char boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 初始化棋盘
class="tags" href="/C.html" title=c>class="token keyword">void class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">initBoardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int j class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; j class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++jclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[jclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token string">'.'class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 打印棋盘
class="tags" href="/C.html" title=c>class="token keyword">void class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">printBoardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int j class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; j class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++jclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>cout class="tags" href="/C.html" title=c>class="token operator"><< boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[jclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator"><< class="tags" href="/C.html" title=c>class="token string">" "class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>cout class="tags" href="/C.html" title=c>class="token operator"><< endlclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 检查棋盘是否已满
class="tags" href="/C.html" title=c>class="token keyword">bool class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">isBoardFullclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int j class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; j class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZEclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++jclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[jclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">== class="tags" href="/C.html" title=c>class="token string">'.'class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">falseclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 检查给定玩家是否在(x, y)位置沿一个方向获胜
class="tags" href="/C.html" title=c>class="token keyword">bool class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">int yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">int dxclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">int dyclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">class="tags" href="/C.html" title=c>char playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">int class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">for class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int i class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; i class="tags" href="/C.html" title=c>class="token operator">< class="tags" href="/C.html" title=c>class="token number">5class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token operator">++iclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">int class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckX class="tags" href="/C.html" title=c>class="token operator">= x class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">* dxclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">int class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckY class="tags" href="/C.html" title=c>class="token operator">= y class="tags" href="/C.html" title=c>class="token operator">+ i class="tags" href="/C.html" title=c>class="token operator">* dyclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckX class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">&& class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckX class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">&& class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckY class="tags" href="/C.html" title=c>class="token operator">>= class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">&& class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckY class="tags" href="/C.html" title=c>class="token operator">< BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">&& boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckYclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckXclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">== playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>countclass="tags" href="/C.html" title=c>class="token operator">++class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">breakclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>count class="tags" href="/C.html" title=c>class="token operator">== class="tags" href="/C.html" title=c>class="token number">5class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 检查给定玩家是否在(x, y)位置获胜
class="tags" href="/C.html" title=c>class="token keyword">bool class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckWinclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">int xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">int yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token keyword">class="tags" href="/C.html" title=c>char playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 检查水平方向class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator">|| class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 检查垂直方向class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator">|| class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 检查两个斜线方向class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator">|| class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator">|| class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckDireclass="tags" href="/C.html" title=c>ctionclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token operator">-class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token number">1class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, playerclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token boolean">falseclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">int class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">mainclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">initBoardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">bool isPlayerX class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">bool gameOver class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token boolean">falseclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">while class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token operator">!gameOverclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">printBoardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">int xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>cout class="tags" href="/C.html" title=c>class="token operator"><< class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(isPlayerX class="tags" href="/C.html" title=c>class="token operator">? class="tags" href="/C.html" title=c>class="token string">"Player X" class="tags" href="/C.html" title=c>class="token operator">: class="tags" href="/C.html" title=c>class="token string">"Player O"class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator"><< class="tags" href="/C.html" title=c>class="token string">", enter your move (row class="tags" href="/C.html" title=c>column): "class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">try class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>cin class="tags" href="/C.html" title=c>class="token operator">>> y class="tags" href="/C.html" title=c>class="token operator">>> xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>cinclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">.class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">failclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>cinclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">.class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>clearclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 清除错误标志class="tags" href="/C.html" title=c>cinclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">.class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">ignoreclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>class-name">numericlass="tags" href="/C.html" title=c>c_limitsclass="tags" href="/C.html" title=c>class="token operator"><streamsizeclass="tags" href="/C.html" title=c>class="token operator">>class="tags" href="/C.html" title=c>class="token operator">::class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">maxclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, class="tags" href="/C.html" title=c>class="token string">'\n'class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">; class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 忽略错误输入class="tags" href="/C.html" title=c>class="token keyword">throw class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">runtime_errorclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token string">"Invalid input. Please enter numbers."class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(x class="tags" href="/C.html" title=c>class="token operator">< class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">|| x class="tags" href="/C.html" title=c>class="token operator">>= BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">|| y class="tags" href="/C.html" title=c>class="token operator">< class="tags" href="/C.html" title=c>class="token number">0 class="tags" href="/C.html" title=c>class="token operator">|| y class="tags" href="/C.html" title=c>class="token operator">>= BOARD_SIZE class="tags" href="/C.html" title=c>class="token operator">|| boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">!= class="tags" href="/C.html" title=c>class="token string">'.'class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token keyword">throw class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">runtime_errorclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token string">"Invalid move. Try again."class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">] class="tags" href="/C.html" title=c>class="token operator">= isPlayerX class="tags" href="/C.html" title=c>class="token operator">? class="tags" href="/C.html" title=c>class="token string">'X' class="tags" href="/C.html" title=c>class="token operator">: class="tags" href="/C.html" title=c>class="token string">'O'class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">class="tags" href="/C.html" title=c>checlass="tags" href="/C.html" title=c>ckWinclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">, boardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[yclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">[xclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">]class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">printBoardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>cout class="tags" href="/C.html" title=c>class="token operator"><< class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(isPlayerX class="tags" href="/C.html" title=c>class="token operator">? class="tags" href="/C.html" title=c>class="token string">"Player X wins!" class="tags" href="/C.html" title=c>class="token operator">: class="tags" href="/C.html" title=c>class="token string">"Player O wins!"class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator"><< endlclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;gameOver class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token keyword">if class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">isBoardFullclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">printBoardclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">)class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>cout class="tags" href="/C.html" title=c>class="token operator"><< class="tags" href="/C.html" title=c>class="token string">"It's a draw!" class="tags" href="/C.html" title=c>class="token operator"><< endlclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;gameOver class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token boolean">trueclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">else class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{isPlayerX class="tags" href="/C.html" title=c>class="token operator">= class="tags" href="/C.html" title=c>class="token operator">!isPlayerXclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">} class="tags" href="/C.html" title=c>class="token keyword">class="tags" href="/C.html" title=c>catclass="tags" href="/C.html" title=c>ch class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token keyword">class="tags" href="/C.html" title=c>const runtime_errorclass="tags" href="/C.html" title=c>class="token operator">& eclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">{class="tags" href="/C.html" title=c>cout class="tags" href="/C.html" title=c>class="token operator"><< eclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">.class="tags" href="/C.html" title=c>class="token funclass="tags" href="/C.html" title=c>ction">whatclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">(class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">) class="tags" href="/C.html" title=c>class="token operator"><< endlclass="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 可以选择在这里处理错误࿰class="tags" href="/C.html" title=c>c;例如跳过当前玩家的回合class="tags" href="/C.html" title=c>class="token class="tags" href="/C.html" title=c>comment">// 或者让玩家重新输入࿰class="tags" href="/C.html" title=c>c;取决于你的游戏规则class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>class="token keyword">return class="tags" href="/C.html" title=c>class="token number">0class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">;
class="tags" href="/C.html" title=c>class="token punclass="tags" href="/C.html" title=c>ctuation">}class="tags" href="/C.html" title=c>code>

在这个修改后的代码中࿰class="tags" href="/C.html" title=c>c;<class="tags" href="/C.html" title=c>code>try-class="tags" href="/C.html" title=c>catclass="tags" href="/C.html" title=c>chclass="tags" href="/C.html" title=c>code>块被用来捕获两种异常情况:

  1. 当<class="tags" href="/C.html" title=c>code>class="tags" href="/C.html" title=c>cinclass="tags" href="/C.html" title=c>code>接收到非数字输入时࿰class="tags" href="/C.html" title=c>c;会进入错误状态。<class="tags" href="/C.html" title=c>code>class="tags" href="/C.html" title=c>cin.fail()class="tags" href="/C.html" title=c>code>检查输入流是否失败࿰class="tags" href="/C.html" title=c>c;如果是࿰class="tags" href="/C.html" title=c>c;则清除错误标志࿰class="tags" href="/C.html" title=c>c;并忽略错误输入直到下一个换行符。然后抛出一个<class="tags" href="/C.html" title=c>code>runtime_errorclass="tags" href="/C.html" title=c>code>异常。
  2. 当用户输入的坐标无效时(即不在棋盘范围内或该位置已被占用)࿰class="tags" href="/C.html" title=c>c;也会抛出一个<class="tags" href="/C.html" title=c>code>runtime_errorclass="tags" href="/C.html" title=c>code>异常。
    在<class="tags" href="/C.html" title=c>code>class="tags" href="/C.html" title=c>catclass="tags" href="/C.html" title=c>chclass="tags" href="/C.html" title=c>code>块中࿰class="tags" href="/C.html" title=c>c;我们捕获了<class="tags" href="/C.html" title=c>code>runtime_errorclass="tags" href="/C.html" title=c>code>异常࿰class="tags" href="/C.html" title=c>c;并打印出异常信息。根据你的游戏规则࿰class="tags" href="/C.html" title=c>c;你可以选择让当前玩家重新输入࿰class="tags" href="/C.html" title=c>c;或者跳过当前玩家的回合࿰class="tags" href="/C.html" title=c>c;或者采取其他适当的错误处理措施。

在这个例子中࿰class="tags" href="/C.html" title=c>c;我们只是打印了错误信息࿰class="tags" href="/C.html" title=c>c;然后循环会继续࿰class="tags" href="/C.html" title=c>c;提示玩家重新输入。


http://www.ppmy.cn/devtools/133837.html

相关文章

软考之面向服务架构SOA

面向服务架构&#xff08;SOA&#xff09;与单体架构的比较 一、引言 在软件开发的历史进程中&#xff0c;架构设计一直是影响系统性能、可维护性和扩展性的关键因素。单体架构和面向服务架构&#xff08;Service-Oriented Architecture, SOA&#xff09;是两种常见的架构设计…

PTA编程题:念数字

念数字 问题描述思路分析解决方案的分步思路具体步骤 参考代码&#xff08;C语言&#xff09;代码分析进一步细节 问题描述 思路分析 我们要把一个整数转换为其各个数字的拼音&#xff0c;并且处理负数的情况。在处理时&#xff0c;整数的每一位都需要转换为对应的拼音。如果是…

【云计算解决方案面试整理】1-2云计算基础概念及云计算技术原理

准备面云计算解决方案的岗位,整理了一些,也请大佬们指点。 文档分为 云计算基础概念、云计算技术原理、主流云计算平台(以天翼云为例)、云计算架构(弹性设计、高可用设计、高性能设计)、安全防护几个方面。 一、云计算基础概念 1.请简要解释一下什么是云计算? 简单说呢…

SpringBoot框架在共享汽车管理中的应用

3系统分析 3.1可行性分析 通过对本共享汽车管理系统实行的目的初步调查和分析&#xff0c;提出可行性方案并对其一一进行论证。我们在这里主要从技术可行性、经济可行性、操作可行性等方面进行分析。 3.1.1技术可行性 本共享汽车管理系统采用SSM框架&#xff0c;JAVA作为开发语…

总结拓展十五:特殊采购业务——寄售采购

1、寄售采购的定义 寄售采购是指供应商提供物料&#xff0c;并将它们存储在你处&#xff0c;在贵公司将这些物料从寄售库存提取&#xff08;转自有&#xff09;之前&#xff0c;该供应商一直是这些物料法律上的所有者。只有当这些物料被贵司转自有领用后&#xff0c;供应商才会…

小面馆叫号取餐流程 佳易王面馆米线店点餐叫号管理系统操作教程

一、概述 【软件资源文件下载在文章最后】 小面馆叫号取餐流程 佳易王面馆米线店点餐叫号管理系统操作教程 点餐软件以其实用的功能和简便的操作&#xff0c;为小型餐饮店提供了高效的点餐管理解决方案&#xff0c;提高了工作效率和服务质量 ‌点餐管理‌&#xff1a;支持电…

马斯克万卡集群AI数据中心引发的科技涟漪:智算数据中心挑战与机遇的全景洞察

一、AI 爆发重塑数据中心格局 随着AI 技术的迅猛发展&#xff0c;尤其是大模型的崛起&#xff0c;其对数据中心产生了极为深远的影响。大模型以其数以亿计甚至更多的参数和对海量数据的处理需求&#xff0c;成为了 AI 发展的核心驱动力之一&#xff0c;同时也为数据中心带来了…

ReactPress:深入解析技术方案设计与源码

ReactPress Github项目地址&#xff1a;https://github.com/fecommunity/reactpress 欢迎提出宝贵的建议&#xff0c;欢迎一起共建&#xff0c;感谢Star。 ReactPress是一个基于React框架开发的开源发布平台&#xff0c;它不仅仅是一个简单的博客系统&#xff0c;更是一个功能全…