でたらめを実装する

This commit is contained in:
yuuki
2024-12-08 20:04:38 +09:00
parent ebf57a832c
commit 85553da9e3
2 changed files with 40 additions and 2 deletions

View File

@@ -514,9 +514,11 @@
}else{
var string = line.toUpperCase().split("")
const abekobe = localStorage.getItem("abekobe") ?? "false";
const detarame = parseFloat(localStorage.getItem("detarame") ?? "0", 10);
for(let symbol of string){
const abekobe = localStorage.getItem("abekobe") ?? "false";
if (abekobe === "true") {
if (symbol === "1") {
@@ -534,6 +536,22 @@
}
}
if (detarame > 0) {
const randomValue = Math.random() * 100;
if (randomValue < detarame) {
const first = ["1", "2"];
const second = ["3", "4", "A", "B"];
if (first.includes(symbol)) {
const firstIndex = Math.floor(Math.random() * first.length);
symbol = first[firstIndex];
} else if (second.includes(symbol)) {
const secondIndex = Math.floor(Math.random() * second.length);
symbol = second[secondIndex];
}
}
}
var error = false
switch(symbol){