From e3d01168620707cc26740aeb2dc79da7a6285fc0 Mon Sep 17 00:00:00 2001 From: Becky Beauchamp Date: Mon, 29 Feb 2016 10:52:48 -0500 Subject: [PATCH 1/5] Adds inline comments --- index.html | 1 + pseudocode.md | 2 +- readMe.md | 3 +++ script.js | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 6e24b37..62ba47e 100644 --- a/index.html +++ b/index.html @@ -81,6 +81,7 @@

+
diff --git a/pseudocode.md b/pseudocode.md index 22532d0..5b79bd1 100644 --- a/pseudocode.md +++ b/pseudocode.md @@ -10,6 +10,7 @@ Add a title Add a timer Randomize location of font divs within boxes + * JS variable numFlipped = 0; variable card = DOM element selecting boxes; @@ -19,7 +20,6 @@ variable cardOneFont = ""; variable cardTwoFont = ""; addEventListener on card for clicks; - if numFlipped <= 2; { function selectCard(); numFlipped++; diff --git a/readMe.md b/readMe.md index 871bca6..fee1d28 100644 --- a/readMe.md +++ b/readMe.md @@ -14,7 +14,10 @@ Play the game here + * When I click a card, the font should be displayed + * When I have two cards revealed, they should be compared and either disappear or completely if matching or go back to their original state if the pair is not a match * When I click "Play Timed Game" a 30 second countdown should be displayed * If I am playing a timed game and have not won by the end of 30 seconds, a screen should be displayed saying I lost diff --git a/script.js b/script.js index 4868a4f..13a5b0e 100644 --- a/script.js +++ b/script.js @@ -1,3 +1,4 @@ +//Awesome job putting this all into one object var game = { numFlipped: 0, card: document.querySelectorAll(".card-back"), @@ -15,6 +16,19 @@ var game = { easyGame: document.querySelector(".easy"), selectLevel: function() { + // I think you could have one callback function for both of these event listeners: + // for example since they have a class of hard and easy maybe change the name of your fonts arrays property to easy & hard + // and write a function like this: + + // this.hardGame.addEventListener("click", this.shuffleFonts); + // this.easyGame.addEventListener("click", this.shuffleFontsHard); + + // shuffleFonts: function(){ + // var type = this.classList[0]; + // var self = game; + // self.shuffleFonts(self.type); + // } + this.hardGame.addEventListener("click", this.shuffleFontsHard); this.easyGame.addEventListener("click", this.shuffleFontsEasy); @@ -57,6 +71,7 @@ var game = { }, shuffleFontsHard: function() { + // I actually really liked that you used self for this instance, it might help in the future iterating on this code var self = game; self.shuffleFonts(self.fontsHard); @@ -97,7 +112,19 @@ var game = { var activeCard = this.firstElementChild; var self = game; + if (self.numFlipped === 0) { + + // I would abstract this into a separate function and call it here: + // self.cardOne = activeCard; + // changeActiveClass(activeCard, self); + + // changeActiveClass = function(activeCard, self){ + // activeCard.classList.remove("inactive"); + // self.cardOne = activeCard; + // self.cardOneFont = activeCard.getAttribute("data-font"); + // self.numFlipped++; + // } activeCard.classList.remove("inactive"); self.cardOne = activeCard; @@ -105,6 +132,11 @@ var game = { self.numFlipped++; } else if (self.numFlipped === 1 && self.cardOne != activeCard) { + // I would do the same thing here in this case: + // self.cardTwo = activeCard; + // changeActiveClass(activeCard, self); + // self.checkAnswer(); + // activeCard.classList.remove("inactive"); self.numFlipped++; @@ -117,6 +149,7 @@ var game = { }, checkAnswer: function() { + // I would separate the setTimeout into a separate method/function from checkAnswer if (this.cardOneFont === this.cardTwoFont) { var selectedCardOne = this.cardOne.parentNode; var selectedCardTwo = this.cardTwo.parentNode; @@ -149,6 +182,8 @@ var game = { }, playTimedGame: function() { + // I would try to break this function down further as well, it's a little dificult to read and understand + // exactly what your trying to achieve var loser = document.querySelector(".loser-outer"); var countdown = document.querySelector(".countdown"); var seconds = 29; From 952b758e1c73554df89e4643bff246c7ee0d8859 Mon Sep 17 00:00:00 2001 From: Becky Beauchamp Date: Mon, 29 Feb 2016 18:16:42 -0500 Subject: [PATCH 2/5] Adds in eval templae --- evaluation-template.md | 25 +++++++++++++++++++++++++ readMe.md | 2 -- script.js | 4 +++- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 evaluation-template.md diff --git a/evaluation-template.md b/evaluation-template.md new file mode 100644 index 0000000..42f47f0 --- /dev/null +++ b/evaluation-template.md @@ -0,0 +1,25 @@ +### Project Feedback + Evaluation + +* __Project Workflow__:Meets Expectations + +Great job on the planning and creating user stories. Also, great job using branches and having frequent git commits! + +>Did you complete the user stories, wireframes, task tracking, and/or ERDs, as specified above? Did you use source control as expected for the phase of the program you’re in (detailed above)? + +* __Technical Requirements__:Exceeds Expectations + +Your memory game not only is very functional, the interface is awesome, and it’s extremely creative. Also, your css/sass is exceptional! I love the user interface and style of your game. + +>Did you deliver a project that met all the technical requirements? Given what the class has covered so far, did you build something that was reasonably complex? + +* __Code Quality__: Exceeds Expectations + + It's great that you were able to put all of your code into a game object, eliminate global variables, and spend time refactoring your code. I left comments that further help to explain how I might go about refactoring it even more. + +>Did you follow code style guidance and best practices covered in class, such as spacing, modularity, and semantic naming? Did you comment your code as your instructors have in class? + +* __Problem Solving__:Exceeds Expectations + +I think you were able to easily solve your problem and had opportunity to focus on your "silver" or "gold" level objectives. Awesome job. + +>Are you able to defend why you implemented your solution in a certain way? Can you demonstrate that you thought through alternative implementations? diff --git a/readMe.md b/readMe.md index fee1d28..00665f8 100644 --- a/readMe.md +++ b/readMe.md @@ -15,9 +15,7 @@ Play the game here - * When I click a card, the font should be displayed - * When I have two cards revealed, they should be compared and either disappear or completely if matching or go back to their original state if the pair is not a match * When I click "Play Timed Game" a 30 second countdown should be displayed * If I am playing a timed game and have not won by the end of 30 seconds, a screen should be displayed saying I lost diff --git a/script.js b/script.js index 13a5b0e..df19d37 100644 --- a/script.js +++ b/script.js @@ -101,7 +101,7 @@ var game = { colorPairs.forEach(function(pair){ if(newColor === pair[0]){ - for (var i=0; i Date: Tue, 1 Mar 2016 09:24:49 -0500 Subject: [PATCH 3/5] Fixes Typos --- evaluation-template.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/evaluation-template.md b/evaluation-template.md index 42f47f0..7fd87d5 100644 --- a/evaluation-template.md +++ b/evaluation-template.md @@ -1,25 +1,28 @@ ### Project Feedback + Evaluation -* __Project Workflow__:Meets Expectations - -Great job on the planning and creating user stories. Also, great job using branches and having frequent git commits! +* __Project Workflow__: **Meets Expectations** >Did you complete the user stories, wireframes, task tracking, and/or ERDs, as specified above? Did you use source control as expected for the phase of the program you’re in (detailed above)? -* __Technical Requirements__:Exceeds Expectations +***Great job on the planning portion and creating user stories. Also, great job using branches and having frequent git commits!*** + -Your memory game not only is very functional, the interface is awesome, and it’s extremely creative. Also, your css/sass is exceptional! I love the user interface and style of your game. +* __Technical Requirements__: **Exceeds Expectations** >Did you deliver a project that met all the technical requirements? Given what the class has covered so far, did you build something that was reasonably complex? -* __Code Quality__: Exceeds Expectations +***Your memory game not only is very functional and rather complex, the interface is awesome, and it’s extremely creative. Also, your css/sass is exceptional! I love the user interface and design of your game.*** + - It's great that you were able to put all of your code into a game object, eliminate global variables, and spend time refactoring your code. I left comments that further help to explain how I might go about refactoring it even more. +* __Code Quality__: **Exceeds Expectations** >Did you follow code style guidance and best practices covered in class, such as spacing, modularity, and semantic naming? Did you comment your code as your instructors have in class? -* __Problem Solving__:Exceeds Expectations + ***It's great that you were able to put all of your code into a game object, eliminate global variables, and spend time refactoring your code. I left comments that further help to explain how I might go about refactoring it even more.*** -I think you were able to easily solve your problem and had opportunity to focus on your "silver" or "gold" level objectives. Awesome job. + +* __Problem Solving__: Meets Expectations >Are you able to defend why you implemented your solution in a certain way? Can you demonstrate that you thought through alternative implementations? + +***You definitely were able to solve your problem and had opportunity to focus on your "silver" or "gold" level objectives. Awesome job!*** From 2665bf7d0a8271043c9322d371017ed3fb470195 Mon Sep 17 00:00:00 2001 From: Becky Beauchamp Date: Tue, 1 Mar 2016 09:26:22 -0500 Subject: [PATCH 4/5] Update evaluation-template.md --- evaluation-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evaluation-template.md b/evaluation-template.md index 7fd87d5..dfcbef1 100644 --- a/evaluation-template.md +++ b/evaluation-template.md @@ -11,7 +11,7 @@ >Did you deliver a project that met all the technical requirements? Given what the class has covered so far, did you build something that was reasonably complex? -***Your memory game not only is very functional and rather complex, the interface is awesome, and it’s extremely creative. Also, your css/sass is exceptional! I love the user interface and design of your game.*** +***Your memory game not only is very functional and rather complex, the interface is awesome, and it’s extremely creative. Also, your CSS/SASS is exceptional! I love the user interface and design of your game.*** * __Code Quality__: **Exceeds Expectations** From 6205c82fb6afbc52cfc5ffb400160d0cf0c605f9 Mon Sep 17 00:00:00 2001 From: Becky Beauchamp Date: Tue, 1 Mar 2016 09:28:39 -0500 Subject: [PATCH 5/5] Fixes Typos --- evaluation-template.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evaluation-template.md b/evaluation-template.md index 7fd87d5..262d19a 100644 --- a/evaluation-template.md +++ b/evaluation-template.md @@ -11,7 +11,7 @@ >Did you deliver a project that met all the technical requirements? Given what the class has covered so far, did you build something that was reasonably complex? -***Your memory game not only is very functional and rather complex, the interface is awesome, and it’s extremely creative. Also, your css/sass is exceptional! I love the user interface and design of your game.*** +***Your memory game not only is very functional and rather complex, the interface is awesome, and it’s extremely creative. Also, your CSS/SASS is exceptional! I love the user interface and design of your game.*** * __Code Quality__: **Exceeds Expectations** @@ -21,7 +21,7 @@ ***It's great that you were able to put all of your code into a game object, eliminate global variables, and spend time refactoring your code. I left comments that further help to explain how I might go about refactoring it even more.*** -* __Problem Solving__: Meets Expectations +* __Problem Solving__: **Exceeds Expectations** >Are you able to defend why you implemented your solution in a certain way? Can you demonstrate that you thought through alternative implementations?