用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

% 红心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'

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值