Код: Выделить всё
let x = document.getElementsByName("interface");
async function begin() {
if (x[0].checked) {
const Easywords = ["Safety", "Steel", "Portal", "Zombie", "Village", "Kitten", "Smoke", "Heaven", "Weapon"]
out1.innerHTML = "Easy Mode"
for (i = 40; i >= 0; i--) {
time.innerHTML = i
if (i == 0) {
out1.innerhtml = "!GAME OVER!"
stop
}
function easyrng() {
const randomIndex = math.floor(math.random() * Easywords.length);
const randomword = Easywords[randomIndex];
word.innerHTML = randomword
}
await sleep(1000)
}
} else if (x[1].checked) {
out1.innerHTML = "Hard Mode"
}
}
function sleep(time) {
return new Promise(resolve => setTimeout(resolve, time));
}Код: Выделить всё
00
0
Your Jumbled Words Will Appear Here!
Please Select Difficulty
Easy
Hard
Подробнее здесь: https://stackoverflow.com/questions/798 ... ng-randoms