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

WIP, scrabble.js has all of the methods. See comments below. [Brrrrrrackets] #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NatashaRaime
Copy link

highest score function is not fully completed, all other methods work or should work


//this function shall draw tiles from the TileBag after each play
Scrabble.prototype.drawTiles = function(num){
this.tilesDrawn = tilesDrawn;

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){

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);}

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];}

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants