当前位置:网站首页>原神方石机关解密
原神方石机关解密
2022-06-24 06:39:00 【海天鹰】
鹤观最东边隐藏的机关用羽毛照一下,出现5个石机关。
太难了,写个代码遍历一下。
采取随机击打的方式
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes"/>
<title>原神方石机关解密</title>
<style>
button { margin:10px; }
</style>
</head>
<body>
<p id='p'> https: //www.bilibili.com/read/cv12370247</p>
<p id='order'></p>
<p id='count'></p>
<div id='result'></div>
<script>
var a = 1, b = 2, c = 2, d = 1, e = 3;
var ac = 0, bc = 0, cc = 0, dc = 0, ec = 0;
var order='';
document.getElementById('p').innerText = '初始 (' + a + ',' + b + ',' + c + ',' + d + ',' + e + ')';
function hit() {
var r = Math.floor(Math.random() * 5) + 1;
if (r == 1) {
order += 'a';
ac++;
if (a < 3)
a++;
else
a = 1;
/*
if (e < 3)
e++;
else
e = 1;
*/
if (b < 3)
b++;
else
b = 1;
var button = document.createElement('button');
button.innerText = 'a:' + ac + ' (' + a + ',' + b + ',' + c + ',' + d + ',' + e + ')';
document.getElementById('result').appendChild(button);
}
if (r == 2) {
order += 'b';
bc++;
if (b < 3)
b++;
else
b = 1;
if (a < 3)
a++;
else
a = 1;
if (c < 3)
c++;
else
c = 1;
var button = document.createElement('button');
button.innerText = 'b:' + bc + ' (' + a + ',' + b + ',' + c + ',' + d + ',' + e + ')';
document.getElementById('result').appendChild(button);
}
if (r == 3) {
order += 'c';
cc++;
if (c < 3)
c++;
else
c = 1;
if (b < 3)
b++;
else
b = 1;
if (d < 3)
d++;
else
d = 1;
var button = document.createElement('button');
button.innerText = 'c:' + cc + ' (' + a + ',' + b + ',' + c + ',' + d + ',' + e + ')';
document.getElementById('result').appendChild(button);
}
if (r == 4) {
order += 'd';
dc++;
if (d < 3)
d++;
else
d = 1;
if (c < 3)
c++;
else
c = 1;
if (e < 3)
e++;
else
e = 1;
var button = document.createElement('button');
button.innerText = 'd:' + dc + ' (' + a + ',' + b + ',' + c + ',' + d + ',' + e + ')';
document.getElementById('result').appendChild(button);
}
if (r == 5) {
order += 'e';
ec++;
if (e < 3)
e++;
else
e = 1;
if (d < 3)
d++;
else
d = 1;
/*
if (a < 3)
a++;
else
a = 1;
*/
var button = document.createElement('button');
button.innerText = 'e:' + ec + ' (' + a + ',' + b + ',' + c + ',' + d + ',' + e + ')';
document.getElementById('result').appendChild(button);
}
document.getElementById('order').innerText = '击打顺序:' + order;
document.getElementById('count').innerHTML = 'a:' + ac + ', b:' + bc + ', c:' + cc + ', d:' + dc + ', e:' + ec + '<br>总击打次数:' + (ac+bc+cc+dc+ec);
if (a == 3 && b == 3 && c == 3 && d == 3 && e == 3){
clearInterval(id);
}
}
var id = setInterval(hit, 10);
</script>
</body>
</html>刷出的最少击打次数

边栏推荐
- On BOM and DOM (3): DOM node operation - element style modification and DOM content addition, deletion, modification and query
- C语言学生管理系统——可检查用户输入合法性,双向带头循环链表
- leetcode:1856. Maximum value of minimum product of subarray
- About Stacked Generalization
- If you want to learn programming well, don't recite the code!
- Cloudcompare & PCL point cloud clipping (based on clipping box)
- Do you know about Statistics?
- Easy car Interviewer: talk about MySQL memory structure, index, cluster and underlying principle!
- Why computers often crash
- leetcode:84. 柱状图中最大的矩形
猜你喜欢

【二叉数学习】—— 树的介绍
Fault analysis | using --force to batch import data leads to partial data loss

Database stored procedure begin end

目标5000万日活,Pwnk欲打造下一代年轻人的“迪士尼乐园”

leetcode:84. The largest rectangle in the histogram

华为云低时延技术的九大绝招

Application of intelligent reservoir management based on 3D GIS system
Oracle case: ohasd crash on AIX
![[binary number learning] - Introduction to trees](/img/7d/c01bb58bc7ec9c88f857d21ed07a2d.png)
[binary number learning] - Introduction to trees

数据库 存储过程 begin end
随机推荐
[binary number learning] - Introduction to trees
How fast? Good province!
puzzle(019.1)Hook、Gear
leetcode:85. 最大矩形
Tencent Security jointly established a data security committee
Fault analysis | using --force to batch import data leads to partial data loss
Why computers often crash
The gadgets developed by freshmen are popular. Netizen: my food is good
Oceanus kudu sink summary
Web address domain name IP query method, what is the use of domain name
How to apply 5g smart pole to smart highway
Do you want to research programming? I got six!
On BOM and DOM (6): bit value calculation of DOM objects and event objects, such as offsetx/top and clearx
[binary tree] - middle order traversal of binary tree
数据库 存储过程 begin end
How to build a website with a domain name? Is the domain name very cheap
About Stacked Generalization
Actual combat | how to deploy flask project using wechat cloud hosting
程序员使用个性壁纸
Distributed cache breakdown