3 Star 6 Fork 6

xyf007/namerena_scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_group_of_2.html 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
xyf007 提交于 2020-10-25 14:26 +08:00 . use ESLint.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>&#x4E8C;&#x4EBA;&#x7EC4;&#x7EC4;&#x961F;</title>
</head>
<body>
<pre>
const stk = document.querySelector('#textdiv>textarea').value.split('\n');
let maxx = 0;
let ans = 0;
let is = 0;
let res = '';
console.log('&#x4F7F;&#x7528;&#x5B8C;&#x4E86;&#x8BB0;&#x5F97;&#x5237;&#x65B0;');
const stl = stk.length;
for (let i = 0; i < stl - 1; i++) {
for (let j = i + 1; j < stl; j++) {
stk.push(`${stk[i]}\n${stk[j]}`);
}
}
/**
* Get the score of a name.
*/
function chk() {
if (is === 0) {
if (stk.length > stl) {
const s = stk[stk.length - 1];
res = s + '\n\n';
document.querySelector('#textdiv>textarea').value = `!test!\n!\n\n${s}`;
document.querySelector('.goBtn').click();
is = 1;
stk.pop();
} else {
alert(`&#x6D4B;&#x8BD5;&#x5DF2;&#x5B8C;&#x6210;
&#x6700;&#x5F3A;2&#x4EBA;&#x7EC4;:
${ans}${maxx}`);
clearInterval(si);
}
} else {
const a = cw().document.querySelectorAll('span.u');
const n = a.length;
if (n) {
if (a[n - 1].textContent.search(
/&#x5B9E;&#x529B;&#x8BC4;&#x4F30;&#x4E2D;...[1-9][1-9]%/) !== -1) {
const sum = cw().document.querySelectorAll('span.u')[10].textContent
.split(' ')[2];
const val = parseInt(sum);
if (val > maxx) {
maxx = val;
ans = res;
}
res += sum + '\n';
is = 0;
if (stk.length >= stl) {
console.log(res);
}
}
}
}
}
const si = setInterval(function() {
chk();
}, 1000);
</pre>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/xyf0076/namerena_scripts.git
git@gitee.com:xyf0076/namerena_scripts.git
xyf0076
namerena_scripts
namerena_scripts
master

搜索帮助