-
Notifications
You must be signed in to change notification settings - Fork 44
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
WIP, scrabble.js has all of the methods. See comments below. [Brrrrrrackets] #27
base: master
Are you sure you want to change the base?
Conversation
|
||
//this function shall draw tiles from the TileBag after each play | ||
Scrabble.prototype.drawTiles = function(num){ | ||
this.tilesDrawn = tilesDrawn; |
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.
Where is this tilesDrawn
variable coming from?
/////////////////////////////Scoring Functions//////////////////////////////////////////// | ||
|
||
// this function shall allocate a 50pt bonus for words of 7 characters | ||
Scrabble.prototype.bonus = function(word){ |
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.
How is this used? It doesn't seem like the score
function is calling it
for (let current of this.arrayOfWords){ | ||
//if the score is already a key in scores, shovel the word into the array of its values | ||
if ((score(current) in this.scores)){ | ||
this.scores[score(current)].push(current);} |
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.
When will a word have more than one score?
if ((score(current) in this.scores)){ | ||
this.scores[score(current)].push(current);} | ||
else { | ||
this.scores[score(word)] = [word];} |
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.
By calling the score()
method here a few times, you're doing a bit of unnecessary work
highest score function is not fully completed, all other methods work or should work