3 Star 6 Fork 6

xyf007/namerena_scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
6_ordered_capital_letters.html 1.85 KB
一键复制 编辑 原始数据 按行查看 历史
xyf007 提交于 2020-11-12 19:43 +08:00 . modify all the wrong 'for's.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>
&#x6DB5;&#x865A;&#x6A21;&#x5F0F;&#xFF08;&#x516D;&#x4F4D;&#x987A;&#x5E8F;&#x5B57;&#x6BCD;&#xFF09;
</title>
</head>
<body>
<pre>
const prefix = '';
const team = '';
let cur = 0;
let names = '';
let result = '';
/**
* Get the name.
* @param {number} cntName Current name.
* @return {String} The name.
*/
function getCharacter(cntName) {
const z6 = cntName;
const z5 = Math.floor(z6 / 26);
const z4 = Math.floor(z5 / 26);
const z3 = Math.floor(z4 / 26);
const z2 = Math.floor(z3 / 26);
const z1 = Math.floor(z2 / 26);
return String.fromCharCode(65 + z1 % 26) + String.fromCharCode(65 + z2 % 26) +
String.fromCharCode(65 + z3 % 26) + String.fromCharCode(65 + z4 % 26) +
String.fromCharCode(65 + z5 % 26) + String.fromCharCode(65 + z6 % 26);
}
/**
* Reload names.
*/
function reload() {
names = team + '\n';
for (let i = 0; i < 10; i++) {
names += ` ${prefix}${getCharacter(cur)}\n`;
cur++;
}
document.querySelector('div>textarea').value = names;
document.querySelector('.goBtn').click();
}
/**
* Search for the names with elites.
*/
function maint() {
if (cw().document.querySelectorAll('div.name').length < 10) {
setTimeout(function() {
maint();
}, 100);
return;
}
const a = cw().document.querySelectorAll('.s_elite3');
for (const name of a) {
result += name.parentElement.previousElementSibling.textContent.replace(
/^\s+|\s+$/g, '') + '\n';
}
document.querySelector('textarea#result').value = result;
reload();
setTimeout(function() {
maint();
}, 100);
}
const NW = document.createElement('textarea');
NW.id = 'result';
document.body.appendChild(NW);
NW.setAttribute('readonly', true);
document.getElementsByClassName('mdframe')[0].setAttribute('style',
'display:none;');
reload();
maint();
</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

搜索帮助