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

Olivia's JS-Scrabble #17

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

secretsharer
Copy link

JS Scrabble

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What patterns were you able to use from your Ruby knowledge to apply to JavaScript? The basic understanding of building a code block, iteration, objects.
What was a challenge you were able to overcome on this assignment? Syntactical differences, functions living and being called in all manner of places, repetitive syntax, having challenges of understanding constructor, vs. class-like objects, and vs prototypes.
What is your favorite thing about learning a new programming language? it has given me a grasp/context of my ability to apply the knowledge i've learned in the first language. Plus, it's new!!
What is your least favorite thing about learning a new programming language? The screeching hauls that is me just trying to get it. I'm SLOW...but thorough!
Do you have any recommendations on how we could improve this project for the next cohort? Noop.
I want to add that I challenged myself to ask for as little help as possible, which was great because it forced me to rely on docs much more, I ACTUALLY UNDERSTAND everything I wrote, and not so great because I really could have used the help. It's 10pm and I'm submitting a pull request, and as of Time.now, I haven't finished the console.log/gameplay/testing.

//iterate over plays
this.plays.forEach(function(word)) {
this.plays[i] += this.plays[i];
Math.sum(this.plays[i]);

Choose a reason for hiding this comment

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

Should this be totalScore += playScrabble.score(word);

@CheezItMan
Copy link

JS Scrabble

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Check
Comprehension questions Check, it's good that you were able to accomplish it on your own and understand all your code. Get some sleep!
General
score calculates score, has appropriate params and return value Check, but there are some problems here. I left an inline note in your code.
highestScoreFrom calculates highest scoring word, has appropriate params and return value Check
Player object
Has name and plays properties Check
Has play, totalScore, hasWon functions The play method should also return false if the player has already won and not add the word in that case.
Has highestScoringWord and highestWordScore functions You should reuse the highestScoringWord method instead of doing a loop in highestWordScore.
Overall A lot of progress here. Nice work, a few things to look at especially your score function.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Some things to look at here.

for (var i = 0; i < word.length; i++) {
points += pointValue[word[i]];
}
if (word.length > 6)

Choose a reason for hiding this comment

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

The end of this function should probably go from:

if (word.length > 6)
var wordscore = word.score + 50;
 };
 return wordscore;
 }

To:

  if (word.length > 6)
    points  += 50;
  return points;
};


Player.prototype.highestWordScore = function() {
var highestWordScore = 0
for (var i = 0; i < wordsPlayed.length; i++) {

Choose a reason for hiding this comment

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

You can call highestScoringWord and use Scrabble.score in this method instead of the loop.

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