Update index.html
Browse files- index.html +11 -3
index.html
CHANGED
|
@@ -4,11 +4,10 @@
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>三門問題遊戲</title>
|
| 7 |
-
<!-- 引入 Google Noto Sans TC 字型 -->
|
| 8 |
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;700&display=swap" rel="stylesheet">
|
| 9 |
<style>
|
| 10 |
body {
|
| 11 |
-
font-family: 'Noto Sans TC', Arial, sans-serif;
|
| 12 |
text-align: center;
|
| 13 |
padding: 20px;
|
| 14 |
background-color: #f0f0f0;
|
|
@@ -85,7 +84,6 @@
|
|
| 85 |
color: #555;
|
| 86 |
}
|
| 87 |
|
| 88 |
-
/* 響應式設計:平板和手機 */
|
| 89 |
@media (max-width: 768px) {
|
| 90 |
body {
|
| 91 |
flex-direction: column;
|
|
@@ -156,6 +154,7 @@
|
|
| 156 |
</div>
|
| 157 |
<button onclick="promptForSimulation(false)">模擬 100 次:2號門不換 (需密碼)</button>
|
| 158 |
<button onclick="promptForSimulation(true)">模擬 100 次:2號門換門 (需密碼)</button>
|
|
|
|
| 159 |
</div>
|
| 160 |
<div class="stats-container">
|
| 161 |
<h2>中獎機率統計</h2>
|
|
@@ -311,6 +310,15 @@
|
|
| 311 |
document.getElementById("message").innerHTML =
|
| 312 |
`模擬完成!已執行 100 次,選擇 2 號門且${action}。<br>請查看右側統計表格。<br><button onclick="resetGame()">再玩一次</button>`;
|
| 313 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
</script>
|
| 315 |
</body>
|
| 316 |
</html>
|
|
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>三門問題遊戲</title>
|
|
|
|
| 7 |
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;700&display=swap" rel="stylesheet">
|
| 8 |
<style>
|
| 9 |
body {
|
| 10 |
+
font-family: 'Noto Sans TC', Arial, sans-serif;
|
| 11 |
text-align: center;
|
| 12 |
padding: 20px;
|
| 13 |
background-color: #f0f0f0;
|
|
|
|
| 84 |
color: #555;
|
| 85 |
}
|
| 86 |
|
|
|
|
| 87 |
@media (max-width: 768px) {
|
| 88 |
body {
|
| 89 |
flex-direction: column;
|
|
|
|
| 154 |
</div>
|
| 155 |
<button onclick="promptForSimulation(false)">模擬 100 次:2號門不換 (需密碼)</button>
|
| 156 |
<button onclick="promptForSimulation(true)">模擬 100 次:2號門換門 (需密碼)</button>
|
| 157 |
+
<button onclick="promptForTenDoors()">進入十門版本 (需密碼)</button>
|
| 158 |
</div>
|
| 159 |
<div class="stats-container">
|
| 160 |
<h2>中獎機率統計</h2>
|
|
|
|
| 310 |
document.getElementById("message").innerHTML =
|
| 311 |
`模擬完成!已執行 100 次,選擇 2 號門且${action}。<br>請查看右側統計表格。<br><button onclick="resetGame()">再玩一次</button>`;
|
| 312 |
}
|
| 313 |
+
|
| 314 |
+
function promptForTenDoors() {
|
| 315 |
+
const password = prompt("請輸入密碼以進入十門版本:");
|
| 316 |
+
if (password === "TenDoors") {
|
| 317 |
+
window.location.href = "ten_doors.html";
|
| 318 |
+
} else {
|
| 319 |
+
alert("密碼錯誤!");
|
| 320 |
+
}
|
| 321 |
+
}
|
| 322 |
</script>
|
| 323 |
</body>
|
| 324 |
</html>
|