Frontend/24_09_13/kopapirollo.html

38 lines
879 B
HTML
Raw Normal View History

2024-09-13 07:25:31 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<p id="USER"></p>
<p id="COMPUTER"></p>
<script>
let weapon;
let weapons = ["kő", "papír", "olló"];
let computer_choice = weapons[((Math.random() * 10) % 3).toFixed(0)];
do{
weapon = prompt("Kő - papír - olló").toLowerCase();
}while(!weapons.includes(weapon));
document.getElementById("USER").innerHTML = weapon;
document.getElementById("COMPUTER").innerHTML = computer_choice;
switch (weapon) {
case value:
break;
default:
break;
}
</script>
</body>
</html>