From ac9ef9f7e8a7e98b6a8cc5c54aa4bc09a3c16cf5 Mon Sep 17 00:00:00 2001 From: nat Date: Thu, 14 Oct 2021 20:50:24 +0800 Subject: [PATCH 1/3] edited script.js --- script.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index bbe8a29..cf61345 100644 --- a/script.js +++ b/script.js @@ -1,4 +1,16 @@ +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 main = function (input) { - var myOutputValue = 'hello world'; - return myOutputValue; + if (input == word) { + gamesWon += 1; + word = generate(); + } + return input + " " + word + " " + gamesWon; }; From ae8bdb0ecd63efad61410ff1a472112b4d733d67 Mon Sep 17 00:00:00 2001 From: nat Date: Thu, 14 Oct 2021 21:14:47 +0800 Subject: [PATCH 2/3] added --- script.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/script.js b/script.js index cf61345..3cdfcb3 100644 --- a/script.js +++ b/script.js @@ -6,11 +6,27 @@ var generate = function () { var word = generate(); var gamesWon = 0; +var guesses = 0; var main = function (input) { 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; } - return input + " " + word + " " + gamesWon; + }; From e97c88a603fea272eefe93d999e864dde2764a1e Mon Sep 17 00:00:00 2001 From: nathaniel <64686163+natisaver@users.noreply.github.com> Date: Thu, 14 Oct 2021 21:34:07 +0800 Subject: [PATCH 3/3] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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