diff --git a/README.md b/README.md index 32019d3..0696451 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ -# Software Engineering 101 - Intro to Coding +1. git clone *link* +2. cd into file +3. make changes, git add ... +4. git commit -m ... +5. git push +6. make pull req diff --git a/script.js b/script.js index bbe8a29..3cdfcb3 100644 --- a/script.js +++ b/script.js @@ -1,4 +1,32 @@ +var generate = function () { + const words = ["banana", "chisel", "faucet"]; + var select = words[Math.floor(Math.random() * words.length)]; + return select; +}; + +var word = generate(); +var gamesWon = 0; +var guesses = 0; + var main = function (input) { - var myOutputValue = 'hello world'; - return myOutputValue; + if (input == word) { + gamesWon += 1; + guesses +=1; + word = generate(); + if (gamesWon == 2) { + return "Game Reset " + "Your Guess: " + input + " The word: " + word + " Games Won: " + gamesWon; + } + else { + return "Your Guess: " + input + " The word: " + word + " Games Won: " + gamesWon; + + } + + } + else{ + guesses = 0; + gamesWon = 0; + word = generate(); + return "That was incorrect. "+ "Your Guess: " + input + " The word: " + word + " Games Won: " + gamesWon; + } + };