diff --git a/index.html b/index.html
new file mode 100644
index 0000000..dc9721f
--- /dev/null
+++ b/index.html
@@ -0,0 +1,11 @@
+
+
+
+
+
+ Rock Paper Scissors
+
+
+
+
+
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..2776e3d
--- /dev/null
+++ b/index.js
@@ -0,0 +1,45 @@
+const getComputerChoice = function () {
+ const choices = ['rock', 'paper', 'scissors']
+ return choices[Math.floor(Math.random() * choices.length)]
+}
+
+const playRound = function (playerSelection, computerSelection) {
+ playerSelection = playerSelection.toLowerCase()
+ let playerWon = false
+
+ if (playerSelection === computerSelection) {
+ return `Tie: both picked ${playerSelection}.`
+ }
+
+ switch (playerSelection) {
+ case 'rock':
+ playerWon = computerSelection === 'scissors'
+ break
+
+ case 'paper':
+ playerWon = computerSelection === 'rock'
+ break
+
+ case 'scissors':
+ playerWon = computerSelection === 'paper'
+ break
+ }
+
+ return playerWon
+}
+
+const game = function (playerSelection) {
+ let playerScore = 0
+
+ for (let i = 0; i < 5; i++) {
+ const result = playRound(playerSelection, getComputerChoice())
+
+ if (result) {
+ playerScore++
+ }
+ }
+
+ document.write(`Your score: ${playerScore}`)
+}
+
+game(prompt('Rock, paper, or scissors?'))