Skip to content
Snippets Groups Projects
Commit 8b1fdb05 authored by Subliminal Guy's avatar Subliminal Guy
Browse files

add plyerScoreElement

parent a2880211
No related branches found
No related tags found
No related merge requests found
...@@ -42,5 +42,5 @@ ...@@ -42,5 +42,5 @@
</main> </main>
</body> </body>
<script src="./index.js"></script> <script src="index.js"></script>
</html> </html>
\ No newline at end of file
...@@ -2,6 +2,9 @@ const options = ["Stein", "Papier", "Schere"]; ...@@ -2,6 +2,9 @@ const options = ["Stein", "Papier", "Schere"];
let playerScore = 0; let playerScore = 0;
let computerScore = 0; let computerScore = 0;
const playerScoreElement = document.getElementById("player-score")
function getRandomComputerResult(){ function getRandomComputerResult(){
const number = Math.floor(Math.random()*options.length); const number = Math.floor(Math.random()*options.length);
return options[number]; return options[number];
...@@ -28,3 +31,5 @@ function getRoundResults(playerChoice){ ...@@ -28,3 +31,5 @@ function getRoundResults(playerChoice){
return `Computer hat gewonnen! ${computerChoice} schlaegt ${playerChoice}`; return `Computer hat gewonnen! ${computerChoice} schlaegt ${playerChoice}`;
} }
} }
console.log(playerScoreElement)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment