<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
var pl=new Array();
var card=new Array();
var m=new Array();
var re=new Array();
var point=new Array();
var v=new Array();
var x=new Array();
var col=new Array();
function rent(){
for(s=1;s<41;s++){
x[s]=0;
col[s]="";
}
for(s=1;s<41;s++){
re[s]=new Array();
}
for(s=1;s<41;s++){
re[s][0]=0;
}
re[2][0]=2;
re[4][0]=4;
col[2]="ブラウン";
col[4]="ブラウン";
re[7][0]=6;
re[9][0]=6;
re[10][0]=8;
col[7]="ライトブルー";
col[9]="ライトブルー";
col[10]="ライトブルー";
re[12][0]=10;
re[14][0]=10;
re[15][0]=12;
col[12]="ライトパープル";
col[14]="ライトパープル";
col[15]="ライトパープル";
re[17][0]=14;
re[19][0]=14;
re[20][0]=16;
col[17]="オレンジ";
col[19]="オレンジ";
col[20]="オレンジ";
re[22][0]=18;
re[24][0]=18;
re[25][0]=20;
col[22]="レッド";
col[24]="レッド";
col[25]="レッド";
re[27][0]=22;
re[28][0]=24;
re[30][0]=24;
col[27]="イエロー";
col[28]="イエロー";
col[30]="イエロー";
re[32][0]=26;
re[33][0]=26;
re[35][0]=28;
col[32]="グリーン";
col[33]="グリーン";
col[35]="グリーン";
re[38][0]=35;
re[40][0]=50;
col[38]="ダークブルー";
col[40]="ダークブルー";
point[ 1 ]= 0 ;
point[ 2 ]= 60 ;
point[ 3 ]= 0 ;
point[ 4 ]= 60 ;
point[ 5 ]= 0 ;
point[ 6 ]= 200 ;
point[ 7 ]= 100 ;
point[ 8 ]= 0 ;
point[ 9 ]= 100 ;
point[ 10 ]= 120 ;
point[ 11 ]= 0 ;
point[ 12 ]= 140 ;
point[ 13 ]= 150 ;
point[ 14 ]= 140 ;
point[ 15 ]= 160 ;
point[ 16 ]= 200 ;
point[ 17 ]= 180 ;
point[ 18 ]= 0 ;
point[ 19 ]= 180 ;
point[ 20 ]= 200 ;
point[ 21 ]= 0 ;
point[ 22 ]= 220 ;
point[ 23 ]= 0 ;
point[ 24 ]= 220 ;
point[ 25 ]= 240 ;
point[ 26 ]= 200 ;
point[ 27 ]= 260 ;
point[ 28 ]= 260 ;
point[ 29 ]= 150 ;
point[ 30 ]= 280 ;
point[ 31 ]= 0 ;
point[ 32 ]= 300 ;
point[ 33 ]= 300 ;
point[ 34 ]= 0 ;
point[ 35 ]= 320 ;
point[ 36 ]= 200 ;
point[ 37 ]= 0 ;
point[ 38 ]= 350 ;
point[ 39 ]= 0 ;
point[ 40 ]= 400 ;
v[ 1 ]= 0 ;
v[ 2 ]= 50 ;
v[ 3 ]= 0 ;
v[ 4 ]= 50 ;
v[ 5 ]= 0 ;
v[ 6 ]= 0 ;
v[ 7 ]= 50 ;
v[ 8 ]= 0 ;
v[ 9 ]= 50 ;
v[ 10 ]= 50 ;
v[ 11 ]= 0 ;
v[ 12 ]= 100 ;
v[ 13 ]= 0 ;
v[ 14 ]= 100 ;
v[ 15 ]= 100 ;
v[ 16 ]= 0 ;
v[ 17 ]= 100 ;
v[ 18 ]= 0 ;
v[ 19 ]= 100 ;
v[ 20 ]= 100 ;
v[ 21 ]= 0 ;
v[ 22 ]= 150 ;
v[ 23 ]= 0 ;
v[ 24 ]= 150 ;
v[ 25 ]= 150 ;
v[ 26 ]= 0 ;
v[ 27 ]= 150 ;
v[ 28 ]= 150 ;
v[ 29 ]= 0 ;
v[ 30 ]= 150 ;
v[ 31 ]= 0 ;
v[ 32 ]= 200 ;
v[ 33 ]= 200 ;
v[ 34 ]= 0 ;
v[ 35 ]= 200 ;
v[ 36 ]= 0 ;
v[ 37 ]= 0 ;
v[ 38 ]= 200 ;
v[ 39 ]= 0 ;
v[ 40 ]= 200 ;
card[ 1 ]=" GO ";
card[ 2 ]=" 地中海通り ";
card[ 3 ]=" 共同基金 ";
card[ 4 ]=" バルティック通り ";
card[ 5 ]=" 所得税 ";
card[ 6 ]=" リーディング鉄道 ";
card[ 7 ]=" オリエンタル通り ";
card[ 8 ]=" チャンス ";
card[ 9 ]=" バーモント通り ";
card[ 10 ]=" コネチカット通り ";
card[ 11 ]=" 刑務所、刑務所見学 ";
card[ 12 ]=" セントチャールズプレース ";
card[ 13 ]=" 電力会社 ";
card[ 14 ]=" ステーツ通り ";
card[ 15 ]=" バージニア通り ";
card[ 16 ]=" ペンシルバニア鉄道 ";
card[ 17 ]=" セントジェームスプレース ";
card[ 18 ]=" 共同基金 ";
card[ 19 ]=" テネシー通り ";
card[ 20 ]=" ニューヨーク通り ";
card[ 21 ]=" フリーパーキング ";
card[ 22 ]=" ケンタッキー通り ";
card[ 23 ]=" チャンス ";
card[ 24 ]=" インディアナ通り ";
card[ 25 ]=" イリノイ通り ";
card[ 26 ]=" B&O 鉄道 ";
card[ 27 ]=" アトランティック通り ";
card[ 28 ]=" ベントノール通り ";
card[ 29 ]=" 水道会社 ";
card[ 30 ]=" マービンガーデン ";
card[ 31 ]=" GO TO JAIL ";
card[ 32 ]=" パシフィック通り ";
card[ 33 ]=" ノースキャロライナ通り ";
card[ 34 ]=" 共同基金 ";
card[ 35 ]=" ペンシルバニア通り ";
card[ 36 ]=" ショートライン鉄道 ";
card[ 37 ]=" チャンス ";
card[ 38 ]=" パークプレース ";
card[ 39 ]=" 物品税 ";
card[ 40 ]=" ボードウォーク ";
}
function sample(){
rent();
mode=4;
pl[1]=1;
pl[2]=1;
pl[3]=1;
pl[4]=1;
m[1]=1500;
m[2]=1500;
m[3]=1500;
m[4]=1500;
var timer;
var delay = 1000;
var loop = function () {
mode=mode+1;
if(mode>4)mode=1;
n1=6*Math.random();
d1=Math.floor(n1)+1;
n1=6*Math.random();
d2=Math.floor(n1)+1;
pl[mode]=pl[mode]+d1+d2;
if(pl[mode]>40)m[mode]=m[mode]+250;
if(pl[mode]>40)pl[mode]=pl[mode]-40;
buy(pl[mode],mode);
sell(pl[mode],mode);
p1=pl[1];
p2=pl[2];
p3=pl[3];
p4=pl[4];
str=card[p1]+"+"+card[p2]+"+"+card[p3]+"+"+card[p4];
str=str+"+"+m[1]+"+"+m[2]+"+"+m[3]+"+"+m[4];
$("#memo").html(str);
clearTimeout(timer);
timer = setTimeout(loop, delay);
}
loop();
}
function buy(x1,mode){
h=0;
if(x1==2)h=h+1;
if(x1==4)h=h+1;
if(x1==7)h=h+1;
if(x1==9)h=h+1;
if(x1==10)h=h+1;
if(x1==12)h=h+1;
if(x1==14)h=h+1;
if(x1==15)h=h+1;
if(x1==16)h=h+1;
if(x1==17)h=h+1;
if(x1==19)h=h+1;
if(x1==20)h=h+1;
if(x1==22)h=h+1;
if(x1==24)h=h+1;
if(x1==25)h=h+1;
if(x1==27)h=h+1;
if(x1==28)h=h+1;
if(x1==30)h=h+1;
if(x1==32)h=h+1;
if(x1==33)h=h+1;
if(x1==35)h=h+1;
if(x1==36)h=h+1;
if(x1==38)h=h+1;
if(x1==40)h=h+1;
if(x[x1]==0)h=h+1;
if(h==2)m[mode]=m[mode]-point[x1];
if(h==2)x[x1]=mode;
}
function sell(x1,mode){
h=0;
if(x1==1)h=h+1;
if(x1==4)h=h+1;
if(x1==7)h=h+1;
if(x1==9)h=h+1;
if(x1==10)h=h+1;
if(x1==12)h=h+1;
if(x1==14)h=h+1;
if(x1==15)h=h+1;
if(x1==16)h=h+1;
if(x1==17)h=h+1;
if(x1==19)h=h+1;
if(x1==20)h=h+1;
if(x1==22)h=h+1;
if(x1==24)h=h+1;
if(x1==25)h=h+1;
if(x1==27)h=h+1;
if(x1==28)h=h+1;
if(x1==30)h=h+1;
if(x1==32)h=h+1;
if(x1==33)h=h+1;
if(x1==35)h=h+1;
if(x1==36)h=h+1;
if(x1==38)h=h+1;
if(x1==40)h=h+1;
mx=x[x1];
if(x[x1]>0)h=h+1;
if(h==2)m[mode]=m[mode]-re[x1][0];
if(h==2)m[mx]=m[mx]+re[x1][0];
}
</script>
最終更新:2018年06月07日 18:32