アットウィキロゴ

おtf

var pos = new Array();
var age = new Array();
var fam = new Array();
var life = new Array();
var number_sh;
var fmx = new Array();
var ch = new Array();
var posx = new Array();
 
function sample() {
 
 
    number_sh = 21;
 
    for (s = 1; s < 22; s++) {
        life[s] = 100;
        pos[s] = s;
    }
 
    /*
    2徳川、1松平
    3水戸、4平家、5藤原
    6一橋、7紀伊、8北条、9柳生、10近衛、11西園寺
    */
 
 
    fam[1] = 2;
    fam[2] = 1;
    fam[4] = 3;
    fam[5] = 4;
    fam[6] = 5;
 
    fam[16] = 6;
    fam[17] = 7;
    fam[18] = 8;
    fam[19] = 9;
    fam[20] = 10;
    fam[21] = 11;
 
 
 
 
 
    tx=0;
    for (s = 1; s < 7; s++) {
    for(sx=1;sx<s+1;sx++){ 
        tx=tx+1;
        age[tx] = 7-s;
    }
    }
 
 
 
    for (a1 = 1; a1 < 7; a1++) {
        death(a1);
    }
 
    famx();
 
 
    for (s = 1; s < number_sh + 1; s++) {
        h = 0;
        if (life[s] > 50) h = h + 1;
        if (fam[s] == 1) h = h + 1;
        if (h == 2) pos[s] = 3;
    }
 
    for (s = 1; s < number_sh + 1; s++) {
        h = 0;
        if (life[s] > 50) h = h + 1;
        if (fam[s] == 2) h = h + 1;
        if (h == 2) pos[s] = 1;
    }
 
 
 
 
 
}
 
 
 
 
 
 
 
function famx() {
 
    matu();
 
    toku();
 
    mito();
 
    heike();
 
    fuji();
 
}
 
function matu(){
 
    var point = new Array();
 
    for (s = 1; s < number_sh + 1; s++) {
        point[s] = 22-pos[s];
        if (fam[s] == 1) point[s] = 1000;
        if (fam[s] == 2) point[s] = 500;
        if (fam[s] == 3) point[s] = 500;
        if (life[s] < 50) point[s] = 0;
    }
    maxpoint = 0;
    sx = 0;
    for (s = 1; s < number_sh + 1; s++) {
        if (point[s] > maxpoint) sx = s;
        if (point[s] > maxpoint) maxpoint=point[s];
    }
 
 
    fam[sx] = 1;
 
 
 
}
 
 
 
function toku() {
 
    var point = new Array();
 
    for (s = 1; s < number_sh + 1; s++) {
        point[s] = 22 - pos[s];
        if (fam[s] == 2) point[s] = 1000 + point[s];
        if (fam[s] == 3) point[s] = 500 + point[s];
        if (fam[s] == 5) point[s] = 100 + point[s];
        if (fam[s] == 6) point[s] = 50 + point[s];
        if (fam[s] == 7) point[s] = 50 + point[s];
        if (fam[s] == 1) point[s] = 0;
        if (life[s] < 50) point[s] = 0;
    }
    maxpoint = 0;
    sx = 0;
    for (s = 1; s < number_sh + 1; s++) {
        if (point[s] > maxpoint) sx = s;
        if (point[s] > maxpoint) maxpoint = point[s];
    }
 
 
    fam[sx] = 2;
 
 
 
}
 
function mito() {
 
    var point = new Array();
 
    for (s = 1; s < number_sh + 1; s++) {
        point[s] = 22 - pos[s];
        if (fam[s] == 3) point[s] = 1000 + point[s];
        if (fam[s] == 6) point[s] = 100 + point[s];
        if (fam[s] == 7) point[s] = 100 + point[s];
        if (fam[s] == 1) point[s] = 0;
        if (fam[s] == 2) point[s] = 0;
        if (life[s] < 50) point[s] = 0;
    }
    maxpoint = 0;
    sx = 0;
    for (s = 1; s < number_sh + 1; s++) {
        if (point[s] > maxpoint) sx = s;
        if (point[s] > maxpoint) maxpoint = point[s];
    }
 
 
    fam[sx] = 3;
 
 
 
}
 
function heike() {
 
    var point = new Array();
 
    for (s = 1; s < number_sh + 1; s++) {
        point[s] = 22 - pos[s];
        if (fam[s] == 4) point[s] = 1000 + point[s];
        if (fam[s] == 8) point[s] = 100 + point[s];
        if (fam[s] == 9) point[s] = 100 + point[s];
        if (fam[s] == 1) point[s] = 0;
        if (fam[s] == 2) point[s] = 0;
        if (life[s] < 50) point[s] = 0;
    }
    maxpoint = 0;
    sx = 0;
    for (s = 1; s < number_sh + 1; s++) {
        if (point[s] > maxpoint) sx = s;
        if (point[s] > maxpoint) maxpoint = point[s];
    }
 
 
    fam[sx] = 4;
 
 
 
}
 
function fuji() {
 
    var point = new Array();
 
    for (s = 1; s < number_sh + 1; s++) {
        point[s] = 22 - pos[s];
        if (fam[s] == 5) point[s] = 1000 + point[s];
        if (fam[s] == 10) point[s] = 100 + point[s];
        if (fam[s] ==11) point[s] = 100 + point[s];
        if (fam[s] == 1) point[s] = 0;
        if (fam[s] == 2) point[s] = 0;
        if (life[s] < 50) point[s] = 0;
    }
    maxpoint = 0;
    sx = 0;
    for (s = 1; s < number_sh + 1; s++) {
        if (point[s] > maxpoint) sx = s;
        if (point[s] > maxpoint) maxpoint = point[s];
    }
 
 
    fam[sx] = 5;
 
 
 
}
 
function death(a1) {
 
    var c = new Array();
 
    sx = 0;
    for (s = 1; s < number_sh + 1; s++) {
        h = 0;
        if (life[s] > 50) h = h + 1;
        if (age[s]==a1) h = h + 1;
        if (h == 2) sx = sx + 1;
        if (h == 2) c[sx] = s;
    }
 
    n1=sx * Math.random();
    n2 = Math.floor(n1) + 1;
    n3=c[n2];
    life[n3] = 0;
 
 
 
 
}
 
最終更新:2015年06月28日 05:20