% clear
M=1000;
Kp=100;
Kz=1;
close all
S={'2','3','4','5','6','7','8','9','10','J','Q','K','A'};
CC={'\diamondsuit','\heartsuit','\clubsuit','\spadesuit'};
PPd=randperm(52);
aa=PPd(1:5);
bb=PPd(6:10);
[anc,an]=ind2sub([4,13],aa);
[bnc,bn]=ind2sub([4,13],bb);
[an,K]=sort(an);
anc=anc(K);
aSC=zeros(3,5);
ppl=find(anc<2);
aSC(1,ppl)=1;
[bn,K]=sort(bn);
bnc=bnc(K);
bSC=zeros(3,5);
ppl=find(bnc<2);
bSC(1,ppl)=1;
figure('Position',[83 79 888 586],'MenuBar','none',...
'NumberTitle','off','name','扑克梭哈');
axes('position',[0.3,0.94,0.2,0.2]);
text(0,0,'\diamondsuit','fontsize',48,'color','r')
axis off
axes('position',[0.37,0.925,0.2,0.2]);
text(0,0,'<','fontsize',56,'color','b')
axis off
axes('position',[0.44,0.94,0.2,0.2]);
text(0,0,'\heartsuit','fontsize',48,'color','r')
axis off
axes('position',[0.51,0.925,0.2,0.2]);
text(0,0,'<','fontsize',56,'color','b')
axis off
axes('position',[0.58,0.94,0.2,0.2]);
text(0,0,'\clubsuit','fontsize',48,'color','black')
axis off
axes('position',[0.65,0.925,0.2,0.2]);
text(0,0,'<','fontsize',56,'color','b')
axis off
axes('position',[0.72,0.94,0.2,0.2]);
text(0,0,'\spadesuit','fontsize',48,'color','black')
axis off
a1=axes('position',[0.1,0.15,0.088 0.3]);
rectangle('position',[0 0 1 1],'Curvature',...
[0.3 0.3],'EdgeColor','b','linewidth',3);
aTS1=text(0.2,0.4,char(CC(anc(1))),'fontsize',58,...
'color',aSC(:,1));
aTN1=text(0.1,0.7,S(an(1)),'fontsize',48);
axis off
a2=axes('position',[0.2,0.15,0.088 0.3]);
rectangle('position',[0 0 1 1],'Curvature',...
[0.3 0.3],'EdgeColor','b','linewidth',3);
aTS2=text(0.2,0.4,char(CC(anc(2))),'fontsize',58,...
'color',aSC(:,2));
aTN2=text(0.1,0.7,S(an(2)),'fontsize',48);
axis off
a3=axes('position',[0.3,0.15,0.088 0.3]);
rectangle('position',[0 0 1 1],'Curvature',...
[0.3 0.3],'EdgeColor','b','linewidth',3);
aTS3=text(0.2,0.4,char(CC(anc(3))),'fontsize',58,...
'color',aSC(:,3));
aTN3=text(0.1,0.7,S(an(3)),'fontsize',48);
axis off
a4=axes('position',[0.4,0.15,0.088 0.3]);
rectangle('position',[0 0 1 1],'Curvature',...
[0.3 0.3],'EdgeColor','b','linewidth',3);
aTS4=text(0.2,0.4,char(CC(anc(4))),'fontsize',58,...
'color',aSC(:,4));
aTN4=text(0.1,0.7,S(an(4)),'fontsize',48);
axis off
a5=axes('position',[0.5,0.15,0.088 0.3]);
rectangle('position',[0 0 1 1],'Curvature',...
[0.3 0.3],'EdgeColor','b','linewidth',3);
aTS5=text(0.2,0.4,char(CC(anc(5))),'fontsize',58,...
'color',aSC(:,5));
aTN5=text(0.1,0.7,S(an(5)),'fontsize',48);
axis off
b1=axes('position',[0.1,0.55,0.088 0.3]);
rectangle('position',[0 0 1 1],'Curvature',...
[0.3 0.3],'EdgeColor','b','linewidth',3);
bTS1=text(0.2,0.4,char(CC(bnc(1))),'fontsize',58,...
'color',bSC(:,1));
bTN1=text(0.1,0.7,S(bn(1)),'fontsize',48);
axis off
b2=axes('position',[0.2,0.55,0.088 0.3]);
rectangle('position',[0 0 1 1],'Curvature',...
[0.3 0.3],'EdgeColor','b','linewidth',3);
bTS2=text(0.2,0.4,char(CC(bnc(2))),'fontsize',58,...
'color',bSC(:,2));
bTN2=text(0.1,0.7,S(bn(2)),'fontsize',48);
axis off
b3=axes('position',[0.3,0.55,0.088 0.3]);
rectangle('position',[0 0 1 1],'Curvature',...
[0.3 0.3],'EdgeColor','b','linewidth',3);
bTS3=text(0.2,0.4,char(CC(bnc(3))),'fontsize',58,...
'color',bSC(:,3));
bTN3=text(0.1,0.7,S(bn(3)),'fontsize',48);
axis off
b4=axes('position',[0.4,0.55,0.088 0.3]);
rectangle('position',[0 0 1 1],'Curvature',...
[0.3 0.3],'EdgeColor','b','linewidth',3);
bTS4=text(0.2,0.4,char(CC(bnc(4))),'fontsize',58,...
'color',bSC(:,4));
bTN4=text(0.1,0.7,S(bn(4)),'fontsize',48);
axis off
b5=axes('position',[0.5,0.55,0.088 0.3]);
rectangle('position',[0 0 1 1],'Curvature',...
[0.3 0.3],'EdgeColor','b','linewidth',3);
bTS5=text(0.2,0.4,char(CC(bnc(5))),'fontsize',58,...
'color',bSC(:,5));
bTN5=text(0.1,0.7,S(bn(5)),'fontsize',48);
axis off
[aR,aT,aSkk]=suosuo(anc,an);
[bR,bT,bSkk]=suosuo(bnc,bn);
aui=uicontrol(gcf,'style','text',...
'unit','normalized','position',[0.6,0.29,0.12,0.06],...
'BackgroundColor','w','ForegroundColor','r',...
'string',aSkk,'fontsize',24);
Mm=uicontrol(gcf,'style','text',...
'unit','normalized','position',[0.79,0.76,0.14,0.07],...
'BackgroundColor','w','ForegroundColor','b',...
'string','Money','fontsize',24);
Mone=uicontrol(gcf,'style','text',...
'unit','normalized','position',[0.79,0.69,0.16,0.06],...
'BackgroundColor','w','ForegroundColor','g',...
'string',num2str(M),'fontsize',24);
zhu=uicontrol(gcf,'style','edit',...
'unit','normalized','position',[0.73,0.29,0.1,0.06],...
'BackgroundColor','w','ForegroundColor','g',...
'string',num2str(Kp),'fontsize',14,'callback',...
['Kp=str2num(get(zhu,''string''));']);
uicontrol(gcf,'style','push',...
'unit','normalized','position',[0.84,0.29,0.1,0.04],...
'BackgroundColor','w','ForegroundColor','g',...
'string','double','fontsize',14,'callback',...
['M=str2num(get(Mone,''string''));','Kp=2*Kp;',...
'set(zhu,''string'',num2str(Kp));',...
'set(Mone,''string'',num2str(M-Kp/2));']);
bui=uicontrol(gcf,'style','text',...
'unit','normalized','position',[0.6,0.69,0.12,0.06],...
'BackgroundColor','w','ForegroundColor','r',...
'string',bSkk,'fontsize',24);
uicontrol(gcf,'style','push',...
'unit','normalized','position',[0.6,0.19,0.1,0.04],...
'BackgroundColor','w','ForegroundColor','g',...
'string','Restar','fontsize',14,'callback','suoha;');
uicontrol(gcf,'style','push',...
'unit','normalized','position',[0.71,0.19,0.1,0.04],...
'BackgroundColor','w','ForegroundColor','g',...
'string','发牌','fontsize',14,'callback','suoha_count;');
uicontrol(gcf,'style','push',...
'unit','normalized','position',[0.82,0.19,0.1,0.04],...
'BackgroundColor','w','ForegroundColor','g',...
'string','换牌','fontsize',14,'callback',...
['suoha_count2;']);
abN=zeros(1,5);
uicontrol(gcf,'style','text',...
'unit','normalized','position',[0,0.49,0.1,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','player','fontsize',14);
uicontrol(gcf,'style','text',...
'unit','normalized','position',[0.01,0.89,0.1,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','computer','fontsize',14);
Bu={'hold off','hold on'};
% button
abutton1=uicontrol(gcf,'style','push',...
'unit','normalized','position',[0.11,0.09,0.06,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','hold off','callback',['abN(1)=not(abN(1));',...
'set(gcbo,''string'',Bu(abN(1)+1));']);
abutton2=uicontrol(gcf,'style','push',...
'unit','normalized','position',[0.21,0.09,0.06,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','hold off','callback',['abN(2)=not(abN(2));',...
'set(gcbo,''string'',Bu(abN(2)+1));']);
abutton3=uicontrol(gcf,'style','push',...
'unit','normalized','position',[0.31,0.09,0.06,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','hold off','callback',['abN(3)=not(abN(3));',...
'set(gcbo,''string'',Bu(abN(3)+1));']);
abutton4=uicontrol(gcf,'style','push',...
'unit','normalized','position',[0.41,0.09,0.06,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','hold off','callback',['abN(4)=not(abN(4));',...
'set(gcbo,''string'',Bu(abN(4)+1));']);
abutton5=uicontrol(gcf,'style','push',...
'unit','normalized','position',[0.51,0.09,0.06,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','hold off','callback',['abN(5)=not(abN(5));',...
'set(gcbo,''string'',Bu(abN(5)+1));']);