• 大小: 11KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-13
  • 语言: Matlab
  • 标签: Matlab  五子棋  游戏  

资源简介

%开发环境:Matlab 7.6 (R2008a). %该程序功能简介: %1. 双人下五子棋,能够判胜负。 %2. 如果选中Hint 3 ,会画出黑白双方在六格之内所有可能形成3的点。 %3. Hint 4 和 Hint 5 的功能与Hint 3同理。 %4. 按一次Back,悔一步棋。 %5. 按下Restart,重新启动程序。

资源截图

代码片段和文件信息

function back
%Back one step
%
%   See also renju.

%By:Ji Lin
%Email: linji@live.com
%Blog: http://linji526.spaces.live.com
%Date: 2008/05/26,2008/08/16

global chessboardMatrix

handles = guihandles(gcf);
stepNo=max(max(chessboardMatrix));

[rowcol]=find(chessboardMatrix==stepNo);
chessboardMatrix(rowcol)=0;
delete(findobj(gcf‘EdgeColor‘‘r‘))
delete(findobj(‘MarkerEdgeColor‘‘c‘))
delete(findobj(‘MarkerEdgeColor‘‘w‘))
delete(findobj(‘MarkerEdgeColor‘‘k‘))
delete(findobj(‘MarkerEdgeColor‘‘r‘))
delete(findobj(‘String‘num2str(stepNo)...
    ‘-and‘‘HorizontalAlignment‘‘center‘))

if stepNo>1
    plotchess(chessboardMatrix);
end

% Change ‘next‘
if mod(stepNo+12)==0
    set(handles.next‘string‘[num2str(stepNo) ‘.Black‘]...
        ‘BackGroundColor‘‘k‘...
        ‘ForeGroundColor‘‘w‘);
else
    set(handles.next‘string‘[num2str(stepNo) ‘.White‘]...
        ‘BackGroundColor‘‘w‘...
        ‘ForeGroundColor‘‘k‘);
end

hint;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        997  2008-08-16 13:50  Renju\back.m

     文件       3524  2008-08-18 14:30  Renju\findfive.m

     文件       4659  2008-08-16 13:53  Renju\findfour.m

     文件       4270  2008-08-16 13:53  Renju\findone.m

     文件       4405  2008-08-16 13:53  Renju\findthree.m

     文件       4408  2008-08-16 13:52  Renju\findtwo.m

     文件        588  2008-08-18 12:53  Renju\hint.m

     文件       3404  2008-08-16 13:52  Renju\hintfive.m

     文件       3319  2008-08-16 13:51  Renju\hintfour.m

     文件       3331  2008-08-16 13:51  Renju\hintthree.m

     文件       1105  2008-08-16 13:54  Renju\mousedown.m

     文件       1435  2008-08-16 13:53  Renju\plotchess.m

     文件       1465  2008-08-16 13:48  Renju\plothint.m

     文件        329  2008-08-18 15:14  Renju\Readme.txt

     文件       4884  2008-08-18 14:20  Renju\renju.m

     目录          0  2008-08-18 15:13  Renju

----------- ---------  ---------- -----  ----

                42123                    16


评论

共有 条评论