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

Amethyst - Setharika Sok #84

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

Conversation

SetharikaSok
Copy link

No description provided.

};

const drawnHand = [];
const allList = Object.entries(letters)

Choose a reason for hiding this comment

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

Nice Rika! This is a clever use of the Object.entries method!

for (let j of input){
if (i.toUpperCase() === j.toUpperCase()) {
++letterCount;
break;

Choose a reason for hiding this comment

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

sumPoint += 8;
}
// console.log(`sumPoint ${sumPoint}`);
return sumPoint;

Choose a reason for hiding this comment

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

💫

Comment on lines +114 to +115
let winnerWord = "";
let winnerScore = 0;

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?

Comment on lines +124 to +135
if (winnerScore < score) {
winnerScore = score;
winnerWord = word;
}
else if (winnerScore === score && word.length === 10 && winnerWord.length !== 10) {
winnerScore = score;
winnerWord = word;
}
else if (winnerScore === score && word.length < winnerWord.length && winnerWord.length !== 10) {
winnerScore = score;
winnerWord = word;
}

Choose a reason for hiding this comment

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

Easy to follow! I love the compound if statements that you made as well!

}
}
console.log({ score: winnerScore, word: winnerWord })
return { score: winnerScore, word: winnerWord };

Choose a reason for hiding this comment

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

Nice job, Rika! 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