diff --git a/script.js b/script.js index ae0bc7e..c4a63f1 100644 --- a/script.js +++ b/script.js @@ -1,8 +1,3 @@ -function getPlayerChoice(){ - let ps = prompt("Rock, Paper, or Scissors?") - - return ps; -} function getComputerChoice(){ let compAnswer = Math.floor(Math.random() * 3) + 1; @@ -46,10 +41,18 @@ function playRound(playerSelection, computerSelection){ } } -function game() { +function game(ps) { let p = 0; let c = 0; + const buttons = document.querySelectorAll('button'); + + buttons.forEach((button) => { + button.addEventListener('click', () => { + console.log(button.id); + }); + }); + while (p < 5 && c < 5) { const ps = getPlayerChoice(); const cs = getComputerChoice();