From 7e43b09a8bc0bd3bfc4c4c621ea9b6161395a8ed Mon Sep 17 00:00:00 2001 From: gormangit Date: Thu, 5 Oct 2017 18:14:59 -0500 Subject: [PATCH 1/8] :party: new branch --- 01week/datatypes.js | 1 + 1 file changed, 1 insertion(+) diff --git a/01week/datatypes.js b/01week/datatypes.js index a258c5235..3e48fa307 100644 --- a/01week/datatypes.js +++ b/01week/datatypes.js @@ -120,6 +120,7 @@ //use an if statement telling program what to console.log('true') if either of the varaibles are true //use blank else statement so the function sudo-stops. //call the function +//blablablabla // var pizza = 1; // var beer = 1; From 808b5e0cf79ab26d15c29b9d72599ba03c46c396 Mon Sep 17 00:00:00 2001 From: gormangit Date: Thu, 5 Oct 2017 20:22:43 -0500 Subject: [PATCH 2/8] RPS --- 01week/rockPaperScissors.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/01week/rockPaperScissors.js b/01week/rockPaperScissors.js index 16f58790a..e5cd88e79 100644 --- a/01week/rockPaperScissors.js +++ b/01week/rockPaperScissors.js @@ -9,7 +9,11 @@ const rl = readline.createInterface({ function rockPaperScissors(hand1, hand2) { - +console.log() +//check for a tie +if (hand1 === hand2){ + return "It's a Tie" +} // Write code here } From fe650517627119e84441e1296a579d925fd256d4 Mon Sep 17 00:00:00 2001 From: gormangit Date: Thu, 5 Oct 2017 20:27:20 -0500 Subject: [PATCH 3/8] RPS1 --- 01week/datatypes.js | 1 - 1 file changed, 1 deletion(-) diff --git a/01week/datatypes.js b/01week/datatypes.js index 3e48fa307..a258c5235 100644 --- a/01week/datatypes.js +++ b/01week/datatypes.js @@ -120,7 +120,6 @@ //use an if statement telling program what to console.log('true') if either of the varaibles are true //use blank else statement so the function sudo-stops. //call the function -//blablablabla // var pizza = 1; // var beer = 1; From fa51bcaf9651ab4c8972acb8b70b83ec40dae3da Mon Sep 17 00:00:00 2001 From: gormangit Date: Fri, 6 Oct 2017 09:26:12 -0500 Subject: [PATCH 4/8] save --- .idea/inspectionProfiles/Project_Default.xml | 7 + .idea/javascript-workbook.iml | 12 ++ .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 180 +++++++++++++++++++ 01week/rockPaperScissors.js | 20 ++- 7 files changed, 232 insertions(+), 7 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/javascript-workbook.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 000000000..db8c7d583 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/javascript-workbook.iml b/.idea/javascript-workbook.iml new file mode 100644 index 000000000..24643cc37 --- /dev/null +++ b/.idea/javascript-workbook.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 000000000..28a804d89 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..316e76d3b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..94a25f7f4 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 000000000..0a1359b7d --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + false + false + true + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -132,6 +153,14 @@ + + + + + + + + @@ -147,21 +176,21 @@ - - + - + - + @@ -185,10 +214,10 @@ - + - - + + @@ -197,18 +226,34 @@ - - + + - + - - + + + + + + + + + + + + + + + + + + From 97a9becc4990652a4a8f3c997b10eab7cc8df6ec Mon Sep 17 00:00:00 2001 From: gormangit Date: Tue, 10 Oct 2017 19:10:00 -0500 Subject: [PATCH 7/8] :pizza: corrections --- .idea/workspace.xml | 85 ++++++++++++++++++++----------------- 01week/rockPaperScissors.js | 24 ++++++----- 2 files changed, 59 insertions(+), 50 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index dea6799da..8cfefa42f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,7 +1,10 @@ - + + + + @@ -14,11 +17,11 @@ - + - - + + @@ -26,8 +29,8 @@ - - + + @@ -36,18 +39,6 @@ - - - - - - - - - - - - @@ -63,8 +54,9 @@ @@ -87,10 +79,9 @@ - @@ -153,11 +144,17 @@ - + + + + + + - - + + + @@ -176,21 +173,21 @@ - - + - + - + - + @@ -224,25 +221,33 @@ - + + + + + + + + + - - + + - + - + - + @@ -250,10 +255,10 @@ - + - - + + diff --git a/01week/rockPaperScissors.js b/01week/rockPaperScissors.js index 58f17501c..e86ca181f 100644 --- a/01week/rockPaperScissors.js +++ b/01week/rockPaperScissors.js @@ -17,22 +17,25 @@ const rl = readline.createInterface({ output: process.stdout }); -var Player1 = "Hand1 Wins!!"; -var Plaer2 = "Hand2 Wins!!"; -var result = Player1.fontcolor("green"); -var result1 = Plaer2.fontcolor("orange"); -function rockPaperScissors(hand1, hand2) { + +function rockPaperScissors(a, b) { //check for a tie + const hand1 = a.toLowerCase().trim(); + + const hand2 = b.toLowerCase().trim(); + + if(hand1 === hand2){ - return '\x1b[5m\x1b[31mIts a Tie\nYou need to redo the turn! \x1b[0m'; + return "It's a tie!"; // Write code here }else if(hand1 === 'rock' && hand2 === 'scissors' || hand1 === 'paper' && hand2 === 'rock' || hand1 === 'scissors' && hand2 === 'paper'){ - return '\x1b[32m\x1b[32mHand1 Wins! \x1b[0m' + return "Hand one wins!" }else if (hand1 === 'rock' && hand2 === 'paper' || hand1 === 'paper' && hand2 === 'scissors' || hand1 === 'scissors' && hand2 === 'rock'){ - return '\x1b[34mHand2 Wins!\x1b[0m' - }else if (hand1 && hand2 !== 'rock', 'paper', 'scissors'){ - return '\x1b[4mYour tryig to play a different game!\x1b[0m' + return "Hand two wins!" } + // else if (hand1 && hand2 !== 'rock', 'paper', 'scissors'){ + // return "\sYour tryig to play a different game!\s" + // } } function getPrompt() { rl.question('hand1: ', (answer1) => { @@ -69,3 +72,4 @@ if (typeof describe === 'function') { getPrompt(); } +//"good programmers look both ways before crossing one way street" \ No newline at end of file From 0e9d1e9ec9002e24799e63a27db7847b57852aa1 Mon Sep 17 00:00:00 2001 From: gormangit Date: Tue, 10 Oct 2017 22:43:08 -0500 Subject: [PATCH 8/8] latest revision --- .idea/misc.xml | 2 +- .idea/workspace.xml | 53 +++++++++++++++++++++++-------------- 01week/rockPaperScissors.js | 33 ++++++++++++----------- 3 files changed, 51 insertions(+), 37 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 28a804d89..24eb271ab 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 8cfefa42f..6cad44af8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,6 +2,7 @@ + @@ -17,11 +18,11 @@ - + - - + + @@ -29,6 +30,16 @@ + + + + + + + + + + @@ -65,10 +76,10 @@ - false + true false - false + true true @@ -79,7 +90,8 @@ - @@ -131,6 +143,9 @@ + + + - - + @@ -229,16 +244,6 @@ - - - - - - - - - - @@ -257,13 +262,21 @@ - - + + + + + + + + + + \ No newline at end of file diff --git a/01week/rockPaperScissors.js b/01week/rockPaperScissors.js index e86ca181f..f0477395d 100644 --- a/01week/rockPaperScissors.js +++ b/01week/rockPaperScissors.js @@ -19,24 +19,22 @@ const rl = readline.createInterface({ function rockPaperScissors(a, b) { -//check for a tie + // make variables that allow the function to pass the test ie. lowercase and whitespace. const hand1 = a.toLowerCase().trim(); - const hand2 = b.toLowerCase().trim(); - - - if(hand1 === hand2){ - return "It's a tie!"; - // Write code here - }else if(hand1 === 'rock' && hand2 === 'scissors' || hand1 === 'paper' && hand2 === 'rock' || hand1 === 'scissors' && hand2 === 'paper'){ - return "Hand one wins!" - }else if (hand1 === 'rock' && hand2 === 'paper' || hand1 === 'paper' && hand2 === 'scissors' || hand1 === 'scissors' && hand2 === 'rock'){ - return "Hand two wins!" - } - // else if (hand1 && hand2 !== 'rock', 'paper', 'scissors'){ - // return "\sYour tryig to play a different game!\s" - // } + //check for a tie + if (hand1 === hand2) { + return "It's a tie!"; + // Write code here + // Check for hand one win + } else if (hand1 === 'rock' && hand2 === 'scissors' || hand1 === 'paper' && hand2 === 'rock' || hand1 === 'scissors' && hand2 === 'paper') { + return "Hand one wins!" + //Check for player two win + } else if (hand1 === 'rock' && hand2 === 'paper' || hand1 === 'paper' && hand2 === 'scissors' || hand1 === 'scissors' && hand2 === 'rock') { + return "Hand two wins!" + } } + function getPrompt() { rl.question('hand1: ', (answer1) => { rl.question('hand2: ', (answer2) => { @@ -72,4 +70,7 @@ if (typeof describe === 'function') { getPrompt(); } -//"good programmers look both ways before crossing one way street" \ No newline at end of file +//"good programmers look both ways before crossing one way street" +//// else if (hand1 && hand2 !== 'rock', 'paper', 'scissors'){ +// return "\sYour tryig to play a different game!\s" +// } \ No newline at end of file