資源簡介
%開發(fā)環(huán)境:Matlab 7.6 (R2008a).
%該程序功能簡介:
%1. 雙人下五子棋,能夠判勝負(fù)。
%2. 如果選中Hint 3 ,會畫出黑白雙方在六格之內(nèi)所有可能形成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
- 上一篇:matlab實現(xiàn)高斯消元法
- 下一篇:粒子濾波算法原理及Matlab程序
評論
共有 條評論