class shougun {
number_sh: number;
life: number[] = new Array();
age: number[] = new Array();
postx: string[] = new Array();
point: any[] = new Array();
pos: any[] = new Array();
fresh(): void {
var sx: number;
var s: number;
for (s = 1; s < 7; s++) {
sx = s + this.number_sh;
this.pos[sx][1] = 15 + s;
this.life[sx] = 100;
this.age[sx] = 1;
}
this.number_sh = this.number_sh + 6;
}
change(g2: number): void {
alert("hfr");
var xx: number[] = new Array();
var n: number;
var s: number;
var h: number;
var a1: number;
var sx: number;
n = 0;
for (s = 1; s < this.number_sh + 1; s++) {
h = 0;
if (this.life[s] > 50) h = h + 1;
a1 = this.age[s] + 1;
if (this.pos[s][a1] == 0) h = h + 1;
if (h == 2) n = n + 1;
if (h == 2) xx[n] = s;
}
var p1: number;
var maxpoint: number;
var cc: number;
var s1: number;
var k: number;
cc = 0;
maxpoint = -999;
for (s = 1; s < n + 1; s++) {
p1 = 0;
s1 = xx[s];
for (sx = 1; sx < this.age[s1] + 1; sx++) {
k = this.pos[s1][sx];
p1 = p1 +this.point[g2][k];
}
if (p1 > maxpoint) cc = s1;
if (p1 > maxpoint) maxpoint = p1;
}
a1 = this.age[cc] + 1;
this.pos[cc][a1] = g2;
}
faststep(): void {
this.postx[0] = "";
this.postx[1] = "将軍";
this.postx[2] = "大老";
this.postx[3] = "駿河城代";
this.postx[4] = "美濃藩主";
this.postx[5] = "伊勢藩主";
this.postx[6] = "信濃藩主";
this.postx[7] = "老中";
this.postx[8] = "駿河老中";
this.postx[9] = "美濃守護";
this.postx[10] = "伊勢守護";
this.postx[11] = "信濃守護";
this.postx[12] = "勘定奉行";
this.postx[13] = "町奉行";
this.postx[14] = "寺社奉行 ";
this.postx[15] = "外国奉行";
this.postx[16] = "美濃代官";
this.postx[17] = "大垣代官";
this.postx[18] = "伊勢代官";
this.postx[19] = "松坂代官";
this.postx[20] = "信濃代官";
this.postx[21] = "松本代官";
var s: number;
var sx: number;
var tx: number;
this.number_sh = 21;
for (s = 1; s < 1000; s++) {
this.pos[s] = new Array();
}
tx = 0;
for (s = 1; s < 7; s++) {
for (sx = 1; sx < s + 1; sx++) {
tx = tx + 1;
this.age[tx] = 7 - s;
this.life[tx] = 100;
this.pos[tx][7 - s] = tx;
}
}
}
death(aa: number): void {
var xx: number[] = new Array();
var n: number;
var s: number;
var h: number;
n = 0;
for (s = 1; s < this.number_sh + 1; s++) {
h = 0;
if (this.life[s] > 50) h = h + 1;
if (this.age[s] == aa) h = h + 1;
if (h == 2) n = n + 1;
if (h == 2) xx[n] = s;
}
var m1: number;
var m2: number;
var m3: number;
m1 = n * Math.random();
m2 = Math.floor(m1) + 1;
m3 = xx[m2];
this.life[m3] = 0;
}
rel(): void {
var s: number;
var sx: number;
for (s = 1; s < 16; s++) {
this.point[s] = new Array();
}
for (s = 1; s < 16; s++) {
for (sx = 0; sx < 22; sx++) {
this.point[s][sx] = 1;
}
}
this.point[1][1] = 1000;
this.point[1][2] = -100;
this.point[1][3] = -100;
this.point[1][4] = 100;
this.point[1][5] = 100;
this.point[1][6] = 100;
this.point[2][2] = 1000;
this.point[2][4] = 50;
this.point[2][5] = 50;
this.point[2][6] = 50;
this.point[1][7] = 100;
this.point[3][2] = 1000;
this.point[3][4] = 50;
this.point[3][5] = 50;
this.point[3][6] = 50;
this.point[3][8] = 100;
this.point[4][4] = 1000;
this.point[4][7] = 10;
this.point[4][8] = 10;
this.point[4][9] = 100;
this.point[5][5] = 1000;
this.point[5][7] = 10;
this.point[5][8] = 10;
this.point[5][10] = 100;
this.point[6][6] = 1000;
this.point[6][7] = 10;
this.point[6][8] = 10;
this.point[6][11] = 100;
this.point[7][7] = 100;
this.point[7][9] = 10;
this.point[7][10] = 10;
this.point[7][11] = 10;
this.point[7][12] = 50;
this.point[7][13] = 50;
this.point[8][8] = 100;
this.point[8][9] = 10;
this.point[8][10] = 10;
this.point[8][11] = 10;
this.point[8][14] = 50;
this.point[8][15] = 50;
this.point[9][9] = 100;
this.point[9][16] = 50;
this.point[9][17] = 50;
this.point[10][10] = 100;
this.point[10][18] = 50;
this.point[10][19] = 50;
this.point[11][11] = 100;
this.point[11][20] = 50;
this.point[11][21] = 50;
this.rel();
}
}
最終更新:2015年06月23日 23:28