-
Notifications
You must be signed in to change notification settings - Fork 112
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 (){ |
There was a problem hiding this comment.
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= { |
There was a problem hiding this comment.
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 = {}; |
There was a problem hiding this comment.
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
newWord.forEach(item =>{ | ||
if (wordFreqMap[item]){ | ||
wordFreqMap[item] ++; | ||
}else{ | ||
wordFreqMap[item]= 1; | ||
} | ||
return wordFreqMap | ||
}); | ||
|
||
lettersInHand.forEach(item =>{ |
There was a problem hiding this comment.
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
if(capWord.length >= 7 ){ | ||
totalScore += 8; | ||
} |
There was a problem hiding this comment.
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
No description provided.