Skip to content

Conversation

@maple-megan333
Copy link

No description provided.

};
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
let hand = [];
while (hand.length < 10) {

Choose a reason for hiding this comment

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

This loops makes sense, and I don't think you really have to worry about it here, but when I see
while loops like this, I think about adding some other kind of guard condition- like limiting the
number of attempts, for example-- to catch a possible infinite loop if there weren't enough letters
to be picked.

const score = word
.toUpperCase()
.split("")
.reduce((accum, letter) => accum + letter_scores[letter], 0);

Choose a reason for hiding this comment

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

oooh, nice use of reduce here for scoring!!

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