用matlab算24点小游戏,Matlab编写的一个24点游戏
function twentyfourgame(arg1)% 本人学习 Matalb GUI编程的一个实例% 本人邮箱:slqinyi@http://www.doczj.com/doc/af9f091e59eef8c75fbfb3fb.html,欢迎共同学习% 程序中的图片可以换成是自己的图片% 图片的文件命名规则如下:方片1~10 为 1~10.jpg% 梅花1~10 为 11~20.jpg%
function twentyfourgame(arg1)
% 本人学习 Matalb GUI编程的一个实例
% 本人邮箱:slqinyi@http://www.doczj.com/doc/af9f091e59eef8c75fbfb3fb.html,欢迎共同学习
% 程序中的图片可以换成是自己的图片
% 图片的文件命名规则如下:方片1~10 为 1~10.jpg
% 梅花1~10 为 11~20.jpg
% 红心1~10 为 21~30.jpg
% 黑桃1~10 为 31~40.jpg
% twentyfour函数中有很多的disp 语句,如果不喜欢,可以注释掉。
% 本程序最后修改时间:2011年3月25日,无版权,欢迎以各种渠道传播
% clf
if nargin < 1
arg1 = 'newgame';
end
if strcmp(arg1, 'newgame')
clf
% set(gcf,'resize','off'); % 禁止调整窗口的大小
set(gcf,'name','算24点 Version 1.0') % 修改标题栏
set(gcf,'numbertitle','off') % 去掉标题栏中的 figure 1
h_pai1 = uicontrol(gcf,'style','edit',...
'unit','normalized','position',[0.1,0.58,0.18,0.3],...
'BackgroundColor',[1,1,1],'ForegroundColor',[0 0 0],...
'fontsize',44,'fontname','times new roman','tag','t_pai1','visible','off');
h_pai2 = uicontrol(gcf,'style','edit',...
'unit','normalized','position',[0.3,0.58,0.18,0.3],...
'BackgroundColor',[1,1,1],'ForegroundColor',[0 0 0],...
'fontsize',44,'fontname','times new roman','tag','t_pai2','visible','off');
h_pai3 = uicontrol(gcf,'style','edit',...
'unit','normalized','position',[0.5,0.58,0.18,0.3],...
'BackgroundColor',[1,1,1],'ForegroundColor',[0 0 0],...
'fontsize',44,'fontname','times new roman','tag','t_pai3','visible','off');
h_pai4 = uicontrol(gcf,'style','edit',...
'unit','normalized','position',[0.7,0.58,0.18,0.3],...
'BackgroundColor',[1,1,1],'ForegroundColor',[0 0 0],...
'fontsize',44,'fontname','times new roman','tag','t_pai4','visible','off');
h_suru = uicontrol(gcf,'style','edit',...
'unit','normalized','position',[0.2,0.225,0.5,0.13],...
'BackgroundColor',[1,1,1],'ForegroundColor',[0 0 0],...
'fontsize',20,'fontname','times new roman','tag','t_suru');
h_daan = uicontrol(gcf,'style','edit',...
'unit','normalized','position',[0.2,0.055,0.5,0.13],...
'BackgroundColor',[1,1,1],'ForegroundColor',[0 0 0],...
'fontsize',20,'fontname','times new roman','tag','t_daan');
h_xing = uicontrol(gcf,'style','pushbutton',...
'unit','normalized','position',[0.74,0.255,0.17,0.1],...
'BackgroundColor',[1,1,1],'ForegroundColor',[0 0 1],...
'fontsize',10,'string','NewGame','callback','twentyfourgame(''newgame'')','tag','t_xing');
h_tiji = uicontrol(gcf,'style','pushbutton',...
'unit','normalized','position',[0.74,0.15,0.17,0.1],...
'BackgroundColor',[1,1,1],'ForegroundColor',[0 0 1],...
'fontsize',10,'string','Submit','callback','twentyfourgame(''submit'')','tag'
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐

所有评论(0)