Skip to content

Water - Jessica#45

Open
jwinchan wants to merge 6 commits into
Ada-C14:masterfrom
jwinchan:master
Open

Water - Jessica#45
jwinchan wants to merge 6 commits into
Ada-C14:masterfrom
jwinchan:master

Conversation

@jwinchan

Copy link
Copy Markdown

Assignment Submission: JS Adagrams

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.

Reflection

Prompt Response
What patterns were you able to use from your Ruby knowledge to apply to JavaScript? I followed very closely to my original code design from Ruby adagrams, such as using a hash to keep track of the frequency of letters and using a case statement when calculating the scores.
Did you need to use different strategies to find information online about JavaScript than you would for Ruby? Stackoverflow rather than javascript docs helped me the most in deciding what syntax to use.
What was something you needed to do independent research on for this project? What did you learn? I had to google the javascript version of .sample and .delete_at; the replacement for .sample was a much clunkier method than the ruby method. I used .splice instead of .delete_at
What was a challenge you were able to overcome on this assignment? I'm getting more comfortable using for_in and for_of loops.
What has been interesting and positive about learning a new programming language? Although the new syntax is confusing, being able to refer back to Ruby applications of the methods is very helpful in deciding the logic of the code.
What is something to focus on your learnings in JavaScript in the next week? Using anonymous functions is still perplexing to me but it's something I'd like to use more of.

@CheezItMan CheezItMan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

JS Adagrams

Major Learning Goals/Code Review

Criteria yes/no, and optionally any details/lines of code to reference
Correctly uses variables, and only uses const and let variables. The program prefers const variables. The program never uses var. ✔️, you do have a few let variables where const is more appropriate.
Practices best-practices in JavaScript syntax. There are semi-colons at the end of most lines that need semi-colons. Variables and functions are named with camelCase. ✔️
Correctly creates and calls functions within an object with proper syntax (parameters, return statements, etc.) ✔️
Uses correct syntax for conditional logic and iteration ✔️
Practices git with at least 3 small commits and meaningful commit messages ✔️
Utilizes unit tests to verify code; tests can run using the command $ npm test test/adagrams.test.js and we see test successes and/or failures ✔️

Functional Requirements

Functional Requirement yes/no
For the drawLetters function, there is an appropriate data structure to store the letter distribution. (You are more likely to draw an 'E' than an 'X'.) ✔️
Utilizes unit tests to verify code; all tests for drawLetters and usesAvailableLetters pass ✔️
Utilizes unit tests to verify code; all tests for scoreWord pass ✔️
Utilizes unit tests to verify code; all tests for highestScoreFrom pass ✔️

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 5+ in Code Review && 3+ in Functional Requirements 💚

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation
Elegant/Clever
Descriptive/Readable
Concise
Logical/Organized

Summary

Nice work Jessica, you hit the learning goals here. Well done.

Comment thread src/adagrams.js
K: 1, L: 4, M: 2, N: 6, O: 8, P: 2, Q: 1, R: 6, S: 4, T: 6,
U: 4, V: 2, W: 2, X: 1, Y: 2, Z: 1 },

drawLetters() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread src/adagrams.js
return lettersInHand;
},

usesAvailableLetters(input,lettersInHand) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍 Just be aware that this changes the lettersInHand array, so the function that calls usesAvailableLetters has their argument modified.

Comment thread src/adagrams.js
return true;
},

scoreWord(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.

👍

Comment thread src/adagrams.js
return winner;
},

breakTie(words) {

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 helper function.

Comment thread src/adagrams.js
return score;
},

highestScoreFrom(words) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread src/adagrams.js

drawLetters() {
// Implement this method for wave 1
let letterArray = [];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

BTW you can leave letterArray as a const because you never reassign the variable. Instead you just push material into the existing array.

Suggested change
let letterArray = [];
const letterArray = [];

Comment thread src/adagrams.js
letterArray.push(letter);
}
}
let lettersInHand = [];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ditto

Suggested change
let lettersInHand = [];
const lettersInHand = [];

Comment thread src/adagrams.js
},

highestScoreFrom(words) {
let winner = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
let winner = {
const winner = {

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