Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raina cambpell PR #85

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

raina cambpell PR #85

wants to merge 6 commits into from

Conversation

Rainacam12
Copy link

No description provided.

Z: 1,
};

let lettersArr = Object.keys(letterPool);

Choose a reason for hiding this comment

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

Remember we want to reserve the use of let for variables to look to re-assign later on and const for variables that we want to protect from re-assignment.

export const drawLetters = () => {
// Implement this method for wave 1
let hand = [];
let letterPoolCopy = [...lettersPool];

Choose a reason for hiding this comment

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

I see you made a copy of lettersPool but it doesn't seemed like it was mutated anywhere. So my question is, do you think we could have just used lettersPool in place of letterPoolCopy?

Choose a reason for hiding this comment

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

Actually, disregard this comment! Upon further inspection I can see where you mutated it!

let input_letter_count = {};
for (let i = 0; i < input.length; i++) {
let letter = input[i];
input_letter_count[letter] = (input_letter_count[letter] || 0) + 1;

Choose a reason for hiding this comment

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

Oh wow, I'm stealing this! 😭

score += 8;
}

return score;

Choose a reason for hiding this comment

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

⭐️

Comment on lines +130 to +131
let highestScore = 0;
let winningWord = '';

Choose a reason for hiding this comment

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

If we know we want to return these variables in object form, could just initialize said object here?

}
}

return { word: winningWord, score: highestScore };

Choose a reason for hiding this comment

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

Very easy to follow!

Choose a reason for hiding this comment

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

Nice job, Raina! As you probably noticed, I didn't give too much feedback due to the scope of the project (Translating your python code to Javascript code). I tried to just point out any glaring issues, if any. With that being said, if you want to discuss anything in greater detail, feel free to reach out to me!

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