var card=new Array();
var money=new Array();
var a=new Array();
var b=new Array();
var point=new Array();
var v=new Array();
function sample() {
a[1]=1;
a[2]=1;
a[3]=1;
a[4]=1;
for(s=1;s<5;s++){
money[s]=1500;
}
for(s=1;s<41;s++){
b[s]=0;
}
var sub=new monopoly();
sub.faststep();
card=sub.card;
point=sub.point;
v=sub.v;
var timer;
var delay = 1000;
mode=4;
var loop = function () {
mode=mode+1;
if(mode>4)mode=1;
var sub2=new monopoly();
sub2.a=a;
sub2.money=money;
sub2.move(mode);
a=sub2.a;
money=sub2.money;
sx=a[mode];
h=0;
if(b[sx]==0)h=h+1;
if(point[sx]>0)h=h+1;
if(h==2)b[sx]=mode;
paint();
clearTimeout(timer);
timer = setTimeout(loop, delay);
}
loop();
}
function paint(){
str="<table>";
for(s=1;s<5;s++){
str=str+"<tr>";
str=str+"<td>";
sx=a[s];
str=str+card[sx];
str=str+"</td>";
str=str+"<td>";
str=str+money[s];
str=str+"</td>";
str=str+"</tr>";
}
str=str+"</table>";
str=str+"<table>";
for(s=1;s<41;s++){
str=str+"<tr>";
str=str+"<td>";
str=str+card[s];
str=str+"</td>";
str=str+"<td>";
sx=b[s];
str=str+sx;
str=str+"</td>";
str=str+"</tr>";
}
str=str+"</table>";
$("#memo").html(str);
}
最終更新:2016年11月20日 10:55