daily pastebin goal
23%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var playerscore = 0;
  2. var computerscore = 0;
  3.  
  4. document.getElementById('cpuscore').innerHTML = computerscore;
  5. document.getElementById('playerscore').innerHTML = playerscore;
  6.  
  7.  
  8.  
  9. rock.addEventListener("click", function() {
  10.     let computerSelection = computerPlay();
  11.   let game = playRound(computerSelection, 'Rock');
  12.     if (game === 'tie') {
  13.         document.getElementById('result').innerHTML = 'Tie!';
  14.   } else if (game === 'player') {
  15.         document.getElementById('result').innerHTML = 'You win!';
  16.         playerscore++;
  17.   } else {
  18.         document.getElementById('result').innerHTML = 'You lose!';
  19.       computerscore++;
  20.   }
  21.   }
  22. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top