Added random PC choice

This commit is contained in:
NetMan 2024-01-03 19:36:00 +01:00
parent f0030bbe6e
commit 4b5f653c2f
1 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,7 @@
const choices = ["rock", "paper", "scissors"];
function getComputerChoice() {
return choices[Math.floor(Math.random() * 3)];
}
console.log(getComputerChoice());