Skip to content

Shaun Harris#210

Open
Shaun-Harris wants to merge 3 commits intoboolean-uk:mainfrom
Shaun-Harris:main
Open

Shaun Harris#210
Shaun-Harris wants to merge 3 commits intoboolean-uk:mainfrom
Shaun-Harris:main

Conversation

@Shaun-Harris
Copy link

Currently running with 1 error submitting for the morning task. current failure:-

".......F

Failures:

  1. Scrabble scores a case-insensitive word
    Message:
    Expected 0 to equal 41."

src/scrabble.js Outdated
Comment on lines 35 to 39
let totalScore = tallyFinalScores(
wordScoreTally,
wordScoreDouble,
wordScoreTriple
)
Copy link
Contributor

Choose a reason for hiding this comment

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

return tallyFinalScores(
      wordScoreTally,
      wordScoreDouble,
      wordScoreTriple
    )

src/scrabble.js Outdated
let openingBracket = 0
let closingBracket = 0

if (word === null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if (!word)

src/scrabble.js Outdated
continue
}
if (word[i - 1] === '{' && word[i + 1] === '}') {
wordScoreDouble += (lettersValues[word[i]] * 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

  • 2

2 is a magic number

Copy link
Contributor

Choose a reason for hiding this comment

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

Move this to a variable so we know what it is.

@Shaun-Harris Shaun-Harris changed the title JS_SCRABBLE Shaun Harris Mar 1, 2024
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