Skip to content

Kayla Ecker - Caret#44

Open
kaylaecker wants to merge 2 commits into
Ada-C8:masterfrom
kaylaecker:master
Open

Kayla Ecker - Caret#44
kaylaecker wants to merge 2 commits into
Ada-C8:masterfrom
kaylaecker:master

Conversation

@kaylaecker

Copy link
Copy Markdown

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? Overall strategy for how to orient the scrabble game
What was a challenge you were able to overcome on this assignment? The change of syntax, particularly now needing to say let etc
What is your favorite thing about learning a new programming language? Realizing that there it is fairly easy(ish) to pick up new languages once you learn one
What is your least favorite thing about learning a new programming language? Some of the fun Ruby tricks I learned can no longer be utilized.
Do you have any recommendations on how we could improve this project for the next cohort? more low level exercises before jumping in. It felt like it was assumed that we would pick up this language very quickly, but with the timeline we are also concerned with CS and splitting time so learning the language on our own was a bit difficult. Being provided more resources would have been beneficial. Overall was okay though!

@CheezItMan

Copy link
Copy Markdown

JS Scrabble

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene WAAAAAAAAAY too few commits!!! I do recognize you've done the same project in Ruby, but a little more granularity is better.
Comprehension questions Check
General
score calculates score, has appropriate params and return value Check
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 Check
Has highestScoringWord and highestWordScore functions Check
Overall You hit all the requirement. Two suggestions, One, turn on the linter and listen to it's advice. It will help you write cleaner, more concise code, Two, make use of the JavaScript array functions like map and reduce, they can help make things more compact.

Comment thread scrabble.js
score: function(word) {
// TODO: implement score
}
score: 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.

This could be written as:

score(word) {

Comment thread scrabble.js
}
score: function(word) {

let regex = /^[a-zA-Z]+$/;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Making variables you never reassign const is a good idea.

Comment thread scrabble.js
let score = 0;


for (let i = 0; i < lowercaseWord.length; i++) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This works fine, you can also use reduce to calculate it.

Comment thread scrabble.js
Scrabble.Player = class {
constructor(name) {
if (name === undefined) {
throw new Error('Invalid - must be a name');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good work creating an object to throw the error.

Comment thread scrabble.js
play(word) {
let regex = /^[a-zA-Z]+$/;

if (word === undefined || !regex.test(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.

Nice use of Regex

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