Skip to content

Amelia | PTBC2-2#40

Open
ameliawibi wants to merge 15 commits into
rocketacademy:masterfrom
ameliawibi:master
Open

Amelia | PTBC2-2#40
ameliawibi wants to merge 15 commits into
rocketacademy:masterfrom
ameliawibi:master

Conversation

@ameliawibi
Copy link
Copy Markdown

@ameliawibi ameliawibi commented Nov 22, 2021

Please fill out the survey before submitting the pull request. Thanks!

🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀

How many hours did you spend on this assignment? 2 days

Please fill in one error and/or error message you received while working on this assignment.
something is not a function (typeError)
Timer and reset is so tricky.

What part of the assignment did you spend the most time on? reset game without having to reload, styling, setInterval clearInterval.

Comfort Level (1-5): 3

Completeness Level (1-5): 5

What did you think of this deliverable? Challenging and fun

Is there anything in this code that you feel pleased about? The Christmas theme :) https://xmas-match-game.netlify.app/

@ameliawibi ameliawibi changed the title Amelia \ Amelia | PTBC2 Nov 22, 2021
@ameliawibi ameliawibi changed the title Amelia | PTBC2 Amelia | PTBC2-2 Nov 29, 2021
Comment thread script.js
let newDeck = [];

// Initialise an array of the 4 suit in our deck. We will loop over this array.
const suit = [
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arrays are better named as plurals, and in the for loop it’s more clear to write something like for suit in suits 😉

Comment thread script.js
};

// Add the new card to the deck
newDeck.push(card);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the deck meant to have double the amount of cards ?

Comment thread script.js

//timer & reset function
const countDown = () => {
handle = setInterval(function () {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is a very minor issue, but consistency is a highly valuable trait, if we have been using arrow functions throughout, it might be a good idea to use an arrow function here as well

Comment thread script.js
}
sec--;
//stop timer if time is out
if (minute === 0 && sec < 0) {
Copy link
Copy Markdown

@liam9408 liam9408 Jan 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does seconds ever go below 0 ?

Copy link
Copy Markdown

@liam9408 liam9408 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work ! The code is clean and very pleasant to read, minor issues on styling but we have plenty of time to fix those later on 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants