From 5313aa0b70a5c1bdbf6f4d2bf1ccd16fca453c12 Mon Sep 17 00:00:00 2001 From: aalitenaye Date: Wed, 4 Sep 2019 21:59:58 -0400 Subject: [PATCH] Game Submission --- game.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/game.js b/game.js index 3d7e01b..c617507 100644 --- a/game.js +++ b/game.js @@ -1,3 +1,24 @@ // Write all your code here // Replace the contents of this file with your own code -console.log('Hello, world!'); +var array1 = ['Paper', 'Scissors', 'Rock'] + +function computerPlay() { + const index = Math.floor(Math.random()*array1.length); + return index; +} + +console.log(computerPlay()); +let result = computerPlay(); +console.log(result) + +function playRound(playerSelection, computerSelection) { + // your code here! +} + +const playerSelection = 'rock' +const computerSelection = computerPlay() +console.log(playRound(playerSelection, computerSelection)) + +function game() { + +}