update test.js

This commit is contained in:
littlefairy 2024-03-18 21:51:49 +08:00
parent 6624b0452d
commit 8a90e7077b
4 changed files with 36 additions and 13 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
out.js.map out.js.map
out.js.deps out.js.deps
package-lock.json

1
node_run/.gitignore vendored
View File

@ -1,4 +1,5 @@
node_modules node_modules
package-lock.json
data.json data.json
queue.json queue.json

View File

@ -3229,13 +3229,13 @@
var _ = this var _ = this
_.a = a _.a = a
_.b = b _.b = b
_.c = 1000 _.target_count = 1000
_.d = 33554431 _.d = 33554431
_.e = c _.e = c
_.f = d _.f = d
_.r = e _.r = e
_.x = f _.x = f
_.z = _.y = 0 _.current_count = _.win_count = 0
_.Q = null _.Q = null
_.ch = g _.ch = g
}, },
@ -4491,7 +4491,7 @@
g = new L.iR(a8, a9, a4, a3, a5, a6, new Float64Array(1)) g = new L.iR(a8, a9, a4, a3, a5, a6, new Float64Array(1))
g.dY(a8, a9) g.dY(a8, a9)
b = g b = g
b.c = 1000 b.target_count = 1000
a = HtmlRenderer.init_out(b) a = HtmlRenderer.init_out(b)
a.r = 2000 a.r = 2000
// return // return
@ -12239,7 +12239,7 @@
s = 1 s = 1
break break
} }
if (p.z >= p.c) { if (p.current_count >= p.target_count) {
q = null q = null
s = 1 s = 1
break break
@ -12251,7 +12251,7 @@
break break
} }
h = H.set_run_time_type_info([m, l, [H.set_run_time_type_info([H.e($.ni()) + p.d++, $.cl()], k)]], j) h = H.set_run_time_type_info([m, l, [H.set_run_time_type_info([H.e($.ni()) + p.d++, $.cl()], k)]], j)
if (p.z === 0) h.pop() if (p.current_count === 0) h.pop()
s = 5 s = 5
return P.async_await(T.c2(h), $async$O) return P.async_await(T.c2(h), $async$O)
case 5: case 5:
@ -12275,25 +12275,46 @@
s = 6 s = 6
break break
case 8: case 8:
if (C.Array.w(o, n.a(f.a[0]).e.gb2())) ++p.y; if (C.Array.w(o, n.a(f.a[0]).e.gb2())) ++p.win_count;
++i; ++i;
++p.z ++p.current_count
s = 3 s = 3
break break
case 4: case 4:
//胜率测试的输出部分
o = t.U o = t.U
n = H.set_run_time_type_info([], o) n = H.set_run_time_type_info([], o)
m = t.Y m = t.Y
l = H.set_run_time_type_info([], m) l = H.set_run_time_type_info([], m)
n.push(T.f(LanData.get_obfuscated_value("pkGN"), null, null, C._JsInt.ag(p.z, 100), null, 0, 0, 0)) n.push(T.f(LanData.get_obfuscated_value("pkGN"), null, null, C._JsInt.ag(p.current_count, 100), null, 0, 0, 0))
if (p.z >= p.c) { //原来的代码用于输出到html
if (p.current_count >= p.target_count) {
o = H.set_run_time_type_info([], o) o = H.set_run_time_type_info([], o)
m = H.set_run_time_type_info([], m) m = H.set_run_time_type_info([], m)
o.push(T.f(LanData.get_obfuscated_value("Pnrn"), null, null, p.y * 100 / p.c, null, 0, 1000, 100)) o.push(T.f(LanData.get_obfuscated_value("Pnrn"), null, null, p.win_count * 100 / p.target_count, null, 0, 1000, 100))
d.push(new T.aq(o, m)) d.push(new T.aq(o, m))
p.c *= 10 p.target_count *= 10
} }
q = new T.aq(n, l) q = new T.aq(n, l)
//捕获胜率
if (p.current_count >= config[stage].count) {
const {
score,
end,
skillLabel
} = config[stage];
var winRate=p.win_count * 100 / config[stage].count
if(winRate<score)
resolve(false, [], winRate, p.current_count);
else if (stage === config.length - 1)
resolve(true, [], winRate);
stage++;
}
s = 1 s = 1
break break
case 1: case 1:

View File

@ -37,7 +37,7 @@ async function test(str){
resources: 'usable', resources: 'usable',
beforeParse(window) { beforeParse(window) {
window.FakelocalStorage = localStorageMock; window.FakelocalStorage = localStorageMock;
window.config =[{"count":10000}]; window.config =[{"count":10000,"score":30}];
window.name_input = str; window.name_input = str;
window.stage = 0; window.stage = 0;
window.skillData = []; window.skillData = [];
@ -59,6 +59,6 @@ async function test(str){
//str="!test!\n!\n\n11@qwerb\n\n1233"; //str="!test!\n!\n\n11@qwerb\n\n1233";
str="!test!\n!\n\n11@qwerb\n1233"; str="!test!\n!\n\n11@qwerb\n\n1233";
test(str) test(str)