This commit is contained in:
shenjack 2024-05-10 19:58:29 +08:00
parent 49e89ad018
commit 769fd4b7cd
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 4 additions and 4 deletions

View File

@ -164,7 +164,7 @@ function wrap_any(names, round) {
return [2 /*return*/, "\u8D62\u5BB6:|".concat(result.source_plr, "|")]; return [2 /*return*/, "\u8D62\u5BB6:|".concat(result.source_plr, "|")];
} }
else if ('win_count' in result) { else if ('win_count' in result) {
win_rate_1 = result.win_count / round; win_rate_1 = result.win_count * 100 / round;
win_rate_str = win_rate_1.toFixed(4); win_rate_str = win_rate_1.toFixed(4);
output_str_1 = "\u6700\u7EC8\u80DC\u7387:|".concat(win_rate_str, "|(").concat(round, "\u8F6E)"); output_str_1 = "\u6700\u7EC8\u80DC\u7387:|".concat(win_rate_str, "|(").concat(round, "\u8F6E)");
// 每 500 轮, 输出一次 // 每 500 轮, 输出一次
@ -176,7 +176,7 @@ function wrap_any(names, round) {
} }
}); });
output_datas_1.forEach(function (data, index) { output_datas_1.forEach(function (data, index) {
var win_rate = data.win_count / data.round; var win_rate = data.win_count * 100 / data.round;
output_str_1 += "\n".concat(win_rate.toFixed(2), "%(").concat(data.round, ")"); output_str_1 += "\n".concat(win_rate.toFixed(2), "%(").concat(data.round, ")");
}); });
} }

View File

@ -146,7 +146,7 @@ async function wrap_any(names: string, round: number): Promise<string> {
return `赢家:|${result.source_plr}|`; return `赢家:|${result.source_plr}|`;
} else if ('win_count' in result) { } else if ('win_count' in result) {
// 胜率结果 // 胜率结果
const win_rate = result.win_count / round; const win_rate = result.win_count * 100 / round;
let win_rate_str = win_rate.toFixed(4); let win_rate_str = win_rate.toFixed(4);
let output_str = `最终胜率:|${win_rate_str}|(${round}轮)`; let output_str = `最终胜率:|${win_rate_str}|(${round}轮)`;
// 每 500 轮, 输出一次 // 每 500 轮, 输出一次
@ -159,7 +159,7 @@ async function wrap_any(names: string, round: number): Promise<string> {
} }
}); });
output_datas.forEach((data, index) => { output_datas.forEach((data, index) => {
const win_rate = data.win_count / data.round; const win_rate = data.win_count * 100 / data.round;
output_str += `\n${win_rate.toFixed(2)}%(${data.round})`; output_str += `\n${win_rate.toFixed(2)}%(${data.round})`;
}); });
} }