Skip to content

Conversation

@mckay1818
Copy link

No description provided.

export const scoreWord = (word) => {
// Implement this method for wave 3
};
while (i < 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.

let usesOnlyAvailableLetters = true;
[...input].forEach((letter) => {
const index = lettersInHand.indexOf(letter);
// indexOf method return -1 if letter not found

Choose a reason for hiding this comment

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

I appreciate the comment

// indexOf method return -1 if letter not found
if (index != -1) {
// for splice, need to specify only 1 letter should be removed
lettersInHand.splice(index, 1);

Choose a reason for hiding this comment

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

concise-- nice usage of splice

};
let score = 0;

[...word].forEach((letter) => {

Choose a reason for hiding this comment

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

nice use of spread syntax

const bestPlays = this.config.players
.map((player) => ({ player, ...this._bestPlay(round, player) }))
.filter(({ player, word, score }) => word !== undefined);
.map((player) => ({ player, ...this._bestPlay(round, player) }))

Choose a reason for hiding this comment

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

Ooh, nice use of map for looping through the players

export const drawLetters = () => {
// Implement this method for wave 1
};
export default class Adagrams {

Choose a reason for hiding this comment

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

OOP!

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