




如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
%五子棋程序 function[]=five() globalahm1n1m2n2th1h2h3colorscorehschass hf=figure('resize','off','name','five',... 'position',[360280560420],'numbertitle','off'); ha=axes; set(gcf,'menubar','none','color',[0.30.30.3]) set(gca,'position',[0.23000.11000.77500.8150]) set(gca,'xlim',[0,9],'ylim',[0,9]) set(ha,'xtick',[],'ytick',[],'box','on') set(ha,'color',[0.70.6,0.6]) set(ha,'DataAspectRatio',[111],'PlotBoxAspectRatio',[111]) x=repmat([0;9],1,9); y=[1:9;1:9]; line(x,y,'color','k') line(y,x,'color','k') hst=uicontrol('style','text','string','Score','fontsize',30,... 'units','normal','position',[0.02,0.55,0.26,0.14],'parent',hf,... 'ForegroundColor','w','backgroundcolor',[0.30.30.3],... 'fontweight','bold'); hsc=uicontrol('style','text','string','0','fontsize',24,... 'units','normal','position',[0.02,0.4,0.26,0.14],'parent',hf,... 'ForegroundColor','w','backgroundcolor',[0.30.30.3],... 'fontweight','bold'); hbt=uicontrol('style','pushbutton','string','Restart','fontsize',18,... 'units','normal','position',[0.02,0.16,0.26,0.14],'parent',hf,... 'fontweight','bold','callback',@restart); color=[... 110; 101; 011; 100; 010; 001; 0.70.30; ]; h1=annotation('ellipse',[0.04,0.84,0.06,0.08],'facecolor','k'); h2=annotation('ellipse',[0.12,0.84,0.06,0.08],'facecolor','k'); h3=annotation('ellipse',[0.2,0.84,0.06,0.08],'facecolor','k'); set(ha,'buttondownfcn',@select2) initialize functioninitialize() globalahm1n1m2n2th1h2h3colorscorehscss a=zeros(9); h=zeros(9)*NaN; m1=[]; n1=[]; m2=[]; n2=[]; score=0; ss=0; k=rs(1:81,5); t=ceil(rand(1,5)*7); a(k)=t; [m,n]=ind2sub([9,9],k); y=9.5-m; x=n-0.5; forp=1:5 h(k(p))=line(x(p),y(p),'marker','o','markersize',24,... 'markerfacecolor',color(t(p),:),'markeredgecolor','none',... 'buttondownfcn',@select1); end t=ceil(rand(1,3)*7); set(h1,'facecolor',color(t(1),:)) set(h2,'facecolor',color(t(2),:)) set(h3,'facecolor',color(t(3),:)) function[k]=rs(s,n); form=1:n t=ceil(rand*length(s)); k(m)=s(t); s(t)=[]; end functionselect1(src,eventdata) globalahm1n1 n1

王子****青蛙
实名认证
内容提供者


最近下载
一种基于双轨缆道的牵引式雷达波在线测流系统.pdf
一种基于双轨缆道的牵引式雷达波在线测流系统.pdf
一种胃肠道超声检查助显剂及其制备方法.pdf
201651206021+莫武林+浅析在互联网时代下酒店的营销策略——以湛江民大喜来登酒店为例.doc
201651206021+莫武林+浅析在互联网时代下酒店的营销策略——以湛江民大喜来登酒店为例.doc
用于空间热电转换的耐高温涡轮发电机转子及其装配方法.pdf
用于空间热电转换的耐高温涡轮发电机转子及其装配方法.pdf
用于空间热电转换的耐高温涡轮发电机转子及其装配方法.pdf
用于空间热电转换的耐高温涡轮发电机转子及其装配方法.pdf
用于空间热电转换的耐高温涡轮发电机转子及其装配方法.pdf