Skip to content

Commit

Permalink
随机数
Browse files Browse the repository at this point in the history
  • Loading branch information
PangXitong committed Mar 23, 2024
1 parent 0d3d239 commit f2f8655
Show file tree
Hide file tree
Showing 15 changed files with 135 additions and 7 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified blog/.DS_Store
Binary file not shown.
Binary file modified blog/tool/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions blog/tool/BMICalculator.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ <h1>体质指数计算器(BMI Calculator)</h1>
<p align="right" style="padding-right: 10%;">开发者:<a href="https://pangxitong.github.io/" target="_blank">庞玺桐</a><br>2023年7月15日</p>

</center>
<center><div style="position: fixed;bottom: 0;width: 100%;padding: 20px;display: flex;justify-content: center;align-items: center;">
<a target="_blank" href="./blog/open.html"><a href="https://ipw.cn/ssl/?site=oldsai.cn" title="本站支持SSL安全访问" target='_blank'><img style='display:inline-block;vertical-align:middle' alt="本站支持SSL安全访问" src="../images/ssl-s1.svg"></a>
<a target="_blank" href="../open.html"><span9>Copyright</span9></a>&nbsp;©&nbsp;2022-2024&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="https://github.com/PangXitong"><span9>PangXitong</span9></a>.
</div></center>
</body>

</html>
2 changes: 1 addition & 1 deletion blog/tool/CutPhoto.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h1>图片切割器</h1>
<div id="result"style="text-align: left;max-width: 800px;"></div></center>
<center><div style="position: fixed;bottom: 0;width: 100%;padding: 20px;display: flex;justify-content: center;align-items: center;">
<a target="_blank" href="./blog/open.html"><a href="https://ipw.cn/ssl/?site=oldsai.cn" title="本站支持SSL安全访问" target='_blank'><img style='display:inline-block;vertical-align:middle' alt="本站支持SSL安全访问" src="../images/ssl-s1.svg"></a>
<a target="_blank" href="../open.html"><span9>Copyright</span9></a>&nbsp;©&nbsp;2022-2023&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="https://github.com/PangXitong"><span9>PangXitong</span9></a>.
<a target="_blank" href="../open.html"><span9>Copyright</span9></a>&nbsp;©&nbsp;2022-2024&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="https://github.com/PangXitong"><span9>PangXitong</span9></a>.
</div></center>

<script>
Expand Down
6 changes: 6 additions & 0 deletions blog/tool/HearingTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,11 @@ <h1>此页面用于测试人类听力水平</h1>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提示:手机音量一档(有按键调整音量到零后,按一次音量+按钮)大约为30dB。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注意:此程序仅做参考,不严格符合医学标准,如有需要请尽快去医院就诊。</p>
<p align="right">庞玺桐2023.6.25</p>

<center><div style="position: fixed;bottom: 0;width: 100%;padding: 20px;display: flex;justify-content: center;align-items: center;">
<a target="_blank" href="./blog/open.html"><a href="https://ipw.cn/ssl/?site=oldsai.cn" title="本站支持SSL安全访问" target='_blank'><img style='display:inline-block;vertical-align:middle' alt="本站支持SSL安全访问" src="../images/ssl-s1.svg"></a>
<a target="_blank" href="../open.html"><span9>Copyright</span9></a>&nbsp;©&nbsp;2022-2024&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="https://github.com/PangXitong"><span9>PangXitong</span9></a>.
</div>
</center>
</body>
</html>
40 changes: 40 additions & 0 deletions blog/tool/Scientific Calculator.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<title>Scientific Calculator</title>
</head>
<body>
<h1>Scientific Calculator</h1>
<input type="text" id="input">
<button onclick="calculate()">Calculate</button>
<script>
function calculate() {
// Declare variables
var num1 = Number(document.getElementById('input').value);
var num2 = Number(document.getElementById('input').value);
var operator = document.getElementById('operator').value;

// Perform calculation based on operator
switch (operator) {
case '+':
result = num1 + num2;
break;
case '-':
result = num1 - num2;
break;
case '*':
result = num1 * num2;
break;
case '/':
result = num1 / num2;
break;
default:
result = "Invalid operator";
}

// Display the result
document.getElementById('input').value = result;
}
</script>
</body>
</html>
7 changes: 6 additions & 1 deletion blog/tool/ToolList.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,15 @@ <h1>工具列表</h1>
<a href="./map.html">网址导航</a>
<p class="description">多引擎搜索和常用网址导航(2024.2.3)</p>
</div>

<div class="repository">
<a href="./random_number.html">随机数</a>
<p class="description">指定范围、数量一次性抽取多个随机数(2024.3.23)</p>
</div>
</div>
<div style="bottom: 50px;text-align: center;margin-top: 80px;">
<a target="_blank" href="./blog/open.html"><a href="https://ipw.cn/ssl/?site=oldsai.cn" title="本站支持SSL安全访问" target='_blank'><img style='display:inline-block;vertical-align:middle' alt="本站支持SSL安全访问" src="../images/ssl-s1.svg"></a>
<a target="_blank" href="../open.html"><span9>Copyright</span9></a>&nbsp;©&nbsp;2022-2023&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="https://github.com/PangXitong"><span9>PangXitong</span9></a>.
<a target="_blank" href="../open.html"><span9>Copyright</span9></a>&nbsp;©&nbsp;2022-2024&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="https://github.com/PangXitong"><span9>PangXitong</span9></a>.
</div>
</center>
</body>
Expand Down
2 changes: 1 addition & 1 deletion blog/tool/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ <h1 align="left"id="title"></h1>
<div class="bottom"style="font-family: 'Open Sans', sans-serif;">
<!--<span1>注意:此页面仍在测试阶段,如果此页面的元素又互相重叠的现象,请在浏览器调节页面缩放。</span1> -->
<br>
<a target="_blank" href="./open.html">Copyright</a>&nbsp;©&nbsp;2023&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="http://github.com/PangXitong">PangXitong</a>. Powered by <a target="_blank" href="http://github.io">Github Pages</a>.</div>
<a target="_blank" href="./open.html">Copyright</a>&nbsp;©&nbsp;2022-2024&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="http://github.com/PangXitong">PangXitong</a>. Powered by <a target="_blank" href="http://github.io">Github Pages</a>.</div>
</body>
</html>

4 changes: 4 additions & 0 deletions blog/tool/md-html.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,9 @@ <h2>HTML代码</h2>

<h2>HTML预览</h2>
<div class="output-container" id="converted-html"></div>
<center><div style="position: fixed;bottom: 0;width: 100%;padding: 20px;display: flex;justify-content: center;align-items: center;">
<a target="_blank" href="./blog/open.html"><a href="https://ipw.cn/ssl/?site=oldsai.cn" title="本站支持SSL安全访问" target='_blank'><img style='display:inline-block;vertical-align:middle' alt="本站支持SSL安全访问" src="../images/ssl-s1.svg"></a>
<a target="_blank" href="../open.html"><span9>Copyright</span9></a>&nbsp;©&nbsp;2022-2024&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="https://github.com/PangXitong"><span9>PangXitong</span9></a>.
</div></center>
</body>
</html>
2 changes: 1 addition & 1 deletion blog/tool/ncm/ncm.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h1>NCM解密程序</h1>

<footer class="footer">
<div class="container">
<p class="pull-left">© PangXitong 2023</p>
<p class="pull-left">© PangXitong 2022-2024</p>

<p class="pull-right">OLDSAI.CN</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion blog/tool/random_badluck.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ <h1>抽签</h1>
<p style="position: fixed;bottom: 40px;width: 100%;padding: 20px;display: flex;justify-content: center;align-items: center;">版权声明:庞玺桐只负责技术支持,抽奖内容由李丽娜编写<br>抽签规则:共30个项目,抽过的不能再被抽出,其中有只三项能被抽出两次。</p>
<center><div style="position: fixed;bottom: 0;width: 100%;padding: 20px;display: flex;justify-content: center;align-items: center;">
<a target="_blank" href="./blog/open.html"><a href="https://ipw.cn/ssl/?site=oldsai.cn" title="本站支持SSL安全访问" target='_blank'><img style='display:inline-block;vertical-align:middle' alt="本站支持SSL安全访问" src="../images/ssl-s1.svg"></a>
<a target="_blank" href="../open.html"><span9>Copyright</span9></a>&nbsp;©&nbsp;2022-2023&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="https://github.com/PangXitong"><span9>PangXitong</span9></a>.
<a target="_blank" href="../open.html"><span9>Copyright</span9></a>&nbsp;©&nbsp;2022-2024&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="https://github.com/PangXitong"><span9>PangXitong</span9></a>.
</div></center>
</body>
</html>
2 changes: 1 addition & 1 deletion blog/tool/random_new.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ <h2 class="result" id="result"></h2>
<p style="position: fixed;bottom: 40px;width: 100%;padding: 20px;display: flex;justify-content: center;align-items: center;">版权声明:庞玺桐负责技术支持,名单为在校学生名单<br>抽签规则:各位变量(var)被抽出的概率相等,每次抽签都是独立重复事件(函数:Math.random()),可能出现一个变量被抽两次。</p>
<center><div style="position: fixed;bottom: 0;width: 100%;padding: 20px;display: flex;justify-content: center;align-items: center;">
<a target="_blank" href="./blog/open.html"><a href="https://ipw.cn/ssl/?site=oldsai.cn" title="本站支持SSL安全访问" target='_blank'><img style='display:inline-block;vertical-align:middle' alt="本站支持SSL安全访问" src="../images/ssl-s1.svg"></a>
<a target="_blank" href="../open.html"><span9>Copyright</span9></a>&nbsp;©&nbsp;2022-2023&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="https://github.com/PangXitong"><span9>PangXitong</span9></a>.
<a target="_blank" href="../open.html"><span9>Copyright</span9></a>&nbsp;©&nbsp;2022-2024&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="https://github.com/PangXitong"><span9>PangXitong</span9></a>.
</div></center>
</body>
</html>
69 changes: 69 additions & 0 deletions blog/tool/random_number.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>随机数生成器</title>
<style>
input {
margin-bottom: 10px;
}
</style>
</head>
<body>
<center>
<div style="max-width: 600px;text-align: left;">
<h1>随机数生成器</h1>
<p>本程序使用Javascript函数“Math.random()”执行随机数抽取</p>
<label for="min">最小值:</label>
<input type="number" id="min" required><br>

<label for="max">最大值:</label>
<input type="number" id="max" required><br>

<label for="decimals">整数(填写“0”)/小数(填写精确到几位小数):</label>
<input type="number" id="decimals" required><br>

<label for="quantity">一次性抽出数量:</label>
<input type="number" id="quantity" required><br>

<label for="repeat">是否重复抽出:</label>
<select id="repeat">
<option value="true"></option>
<option value="false"></option>
</select><br>

<button onclick="generateRandomNumbers()">生成随机数</button>

<div id="result"></div>
</div>
</center>
<script>
function generateRandomNumbers() {
var min = parseInt(document.getElementById("min").value);
var max = parseInt(document.getElementById("max").value);
var decimals = parseInt(document.getElementById("decimals").value);
var quantity = parseInt(document.getElementById("quantity").value);
var repeat = document.getElementById("repeat").value === "true";

var result = document.getElementById("result");
result.innerHTML = "";

for (var i = 0; i < quantity; i++) {
var randomNum = Math.random() * (max - min) + min;
randomNum = parseFloat(randomNum.toFixed(decimals));

if (!repeat) {
result.innerHTML += "随机数 " + (i + 1) + ": " + randomNum + "<br>";
} else {
result.innerHTML += "随机数 " + (i + 1) + ": " + randomNum + "<br>";
}
}
}
</script>
<center><div style="position: fixed;bottom: 0;width: 100%;padding: 20px;display: flex;justify-content: center;align-items: center;">
<a target="_blank" href="./blog/open.html"><a href="https://ipw.cn/ssl/?site=oldsai.cn" title="本站支持SSL安全访问" target='_blank'><img style='display:inline-block;vertical-align:middle' alt="本站支持SSL安全访问" src="../images/ssl-s1.svg"></a>
<a target="_blank" href="../open.html"><span9>Copyright</span9></a>&nbsp;©&nbsp;2022-2024&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by <a target="_blank" href="https://github.com/PangXitong"><span9>PangXitong</span9></a>.
</div></center>
</body>
</html>
2 changes: 1 addition & 1 deletion blog/tool/search-engine.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ <h1>多搜索引擎搜索</h1>
<div class="footer">
<a href="https://ipw.cn/ssl/?site=oldsai.cn" title="本站支持SSL安全访问" target='_blank'><img alt="本站支持SSL安全访问" src="https://static.ipw.cn/icon/ssl-s1.svg"></a>
<a target="_blank" href="./open.html">Copyright</a>
&nbsp;©&nbsp;2022-2023&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by
&nbsp;©&nbsp;2022-2024&nbsp;PangXitong.&nbsp;&nbsp;All rights reserved. Open source project by
<a target="_blank" href="http://github.com/PangXitong">PangXitong</a>.
Powered by <a target="_blank" href="http://github.io">Github Pages</a>
</div>
Expand Down

0 comments on commit f2f8655

Please sign in to comment.