diff --git a/game/index.js b/game/index.js index 78a65c62d2162f7cb865803fbbd744cd29a6e7e7..03c2c169287900d94399f42391ce33c8e4e06b65 100644 --- a/game/index.js +++ b/game/index.js @@ -1,6 +1,8 @@ const options = ["Stein", "Papier", "Schere"]; function getRandomComputerResult(){ - console.log(Math.random()); + const number = Math.floor(Math.random()*options.length); + return options[number]; } -getRandomComputerResult(); \ No newline at end of file + +console.log(getRandomComputerResult()); \ No newline at end of file