function [a,b,c]=testall(n,r)
%a龙牙次数b龙吟次数c穿云次数 n测试次数 r加速
a=0;b=0;c=0;
zhican=0;
zhishang=0;
gcd=1.5-r;
cdlongyin=0;
for i=1:n
if zhican==1 %有致残就打龙牙
a=a+1;
if rand > 0.35 %判断虎贲
zhican=0;
end
if rand < 0.3 %判断龙胆
cdlongyin=0;
end
else
if cdlongyin==0 %cd好了就打龙吟
b=b+1;
cdlongyin=7;
zhican = 1;
else
c=c+1;
zhishang=zhishang+1;
end
end
if zhishang ==3
zhican = 1;
zhishang = 0;
end
if cdlongyin ~= 0
cdlongyin=cdlongyin-gcd;
if cdlongyin < 0
cdlongyin = 0;
end
end
end
end
function Main(t)
all= zeros(5,3);
nohb= zeros(5,3);
nold= zeros(5,3);
for i=1:5
[all(i,1),all(i,2),all(i,3)] = testall(t,(i-1)/16);
[nohb(i,1),nohb(i,2),nohb(i,3)] = testnohb(t,(i-1)/16);
[nold(i,1),nold(i,2),nold(i,3)] = testnold(t,(i-1)/16);
end
all = all / t
nohb = nohb /t
nold = nold / t
试一试@用户名 立即召唤神龙 小伙伴会收到通知喔:)无需加好友即可通知到