SOURCE

const down = [100, 100, 100, 100, 100, 100];
const host = 0;

// 闲家总数
var sum = 0;
var hostsum = down[host];
down.forEach((v, i) => {
    if (i !== host) {
        sum += v;
    }
})
var bate = [0, 0, 0, 0, 0, 0];
down.forEach((v, i) => {
    if (i !== host) {
        bate[i] = hostsum / sum;
    } else {
        bate[i] = -1;
    }
})

// 假设庄赢5,2,3,4号,庄输1
var win = [0, 0, 0, 0, 0, 0];
win[1] = down[1] * bate[1];
win[2] = -down[2] * bate[2] * 0.98;
win[3] = -down[3] * bate[3] * 0.98;
win[4] = -down[4] * bate[4] * 0.98;
win[5] = -down[5] * bate[5] * 0.98;
console.log(win[1] + win[2] + win[3] + win[4] + win[5])
console.log(hostsum - down[2] - down[3] - down[4] - down[5] + down[1] + win[5] + win[1] + win[2] + win[3] + win[4])

// // 假设庄赢1,3,4,5号,庄输2
var win = [0, 0, 0, 0, 0, 0];
win[2] = down[2] * bate[2];
win[1] = -down[1] * bate[1] * 0.98;
win[3] = -down[3] * bate[3] * 0.98;
win[4] = -down[4] * bate[4] * 0.98;
win[5] = -down[5] * bate[5] * 0.98;
console.log(win[2] + win[1] + win[3] + win[4] + win[5])
console.log(hostsum - down[1] - down[3] - down[4] - down[5] + down[2] + win[5] + win[1] + win[2] + win[3] + win[4])

// 假设庄赢1
var win = [0, 0, 0, 0, 0, 0];
win[2] = down[2] * bate[2];
win[1] = -down[1] * bate[1] * 0.98;
win[3] = down[3] * bate[3];
win[4] = down[4] * bate[4];
win[5] = down[5] * bate[5];
console.log(win[2] + win[1] + win[3] + win[4] + win[5])
console.log(hostsum - down[1] + down[3] + down[4] + down[5] + down[2] + win[5] + win[1] + win[2] + win[3] + win[4])

// 假设庄全输
var win = [0, 0, 0, 0, 0, 0];
win[2] = down[2] * bate[2];
win[1] = down[1] * bate[1];
win[3] = down[3] * bate[3];
win[4] = down[4] * bate[4];
win[5] = down[5] * bate[5];
console.log(win[2] + win[1] + win[3] + win[4] + win[5])
console.log(hostsum + down[1] + down[3] + down[4] + down[5] + down[2] + win[5] + win[1] + win[2] + win[3] + win[4])
// 假设庄全赢
var win = [0, 0, 0, 0, 0, 0];
win[2] = -down[1] * bate[1] * 0.98;
win[1] = -down[1] * bate[1] * 0.98;
win[3] = -down[1] * bate[1] * 0.98;
win[4] = -down[1] * bate[1] * 0.98;
win[5] = -down[1] * bate[1] * 0.98;
console.log(win[2] + win[1] + win[3] + win[4] + win[5])
console.log(hostsum - down[1] - down[3] - down[4] - down[5] - down[2] + win[5] + win[1] + win[2] + win[3] + win[4])
console 命令行工具 X clear

                    
>
console