Skip to content

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

Open
NatashaRaime wants to merge 1 commit into
Ada-C6:masterfrom
NatashaRaime:master
Open

WIP, scrabble.js has all of the methods. See comments below. [Brrrrrrackets]#27
NatashaRaime wants to merge 1 commit into
Ada-C6:masterfrom
NatashaRaime:master

Conversation

@NatashaRaime

Copy link
Copy Markdown

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

Comment thread index.js

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

Copy link
Copy Markdown

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?

Comment thread index.js
/////////////////////////////Scoring Functions////////////////////////////////////////////

// this function shall allocate a 50pt bonus for words of 7 characters
Scrabble.prototype.bonus = function(word){

Copy link
Copy Markdown

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

Comment thread index.js
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);}

Copy link
Copy Markdown

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?

Comment thread index.js
if ((score(current) in this.scores)){
this.scores[score(current)].push(current);}
else {
this.scores[score(word)] = [word];}

Copy link
Copy Markdown

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