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

Sea Turtles/Theresa Davis #112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Sea Turtles/Theresa Davis #112

wants to merge 1 commit into from

Conversation

perugia33
Copy link

No description provided.

Copy link

@tgoslee tgoslee left a comment

Choose a reason for hiding this comment

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

Great work with what you did! I left some comments on some things you can refactor and some cool things you implemented! Let me know if you have any questions!

'Z': 10
}

export const generateRandomLetter = function (){
Copy link

Choose a reason for hiding this comment

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

👍🏽

let letters = [];
let i = 0;
let letterPool = {};
const LETTER_POOL= {
Copy link

Choose a reason for hiding this comment

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

you already have a letterPool constant so you don't need this one

export const usesAvailableLetters = (input, lettersInHand) => {
// Implement this method for wave 2
};
let wordFreqMap = {};
Copy link

Choose a reason for hiding this comment

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

great use of frequency maps

Comment on lines +124 to +133
newWord.forEach(item =>{
if (wordFreqMap[item]){
wordFreqMap[item] ++;
}else{
wordFreqMap[item]= 1;
}
return wordFreqMap
});

lettersInHand.forEach(item =>{
Copy link

Choose a reason for hiding this comment

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

Here you are performing similar operations for frequency maps for newWord and lettersInHand, this means you could create a helper function that takes in a string and returns a frequency map of letters

Comment on lines +173 to +175
if(capWord.length >= 7 ){
totalScore += 8;
}
Copy link

Choose a reason for hiding this comment

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

this could also be a ternary operator

let totalScore = capWord.length >= 7 ? 8 : 0;

then replace line 167 with it

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