Skip to content

Earth/Taylor#32

Open
TaylorMililani wants to merge 13 commits into
Ada-C14:masterfrom
TaylorMililani:master
Open

Earth/Taylor#32
TaylorMililani wants to merge 13 commits into
Ada-C14:masterfrom
TaylorMililani:master

Conversation

@TaylorMililani

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? the behavior of data structures and if statements. Semicolons and declaring variables are hard to get used to though.
Did you need to use different strategies to find information online about JavaScript than you would for Ruby? not really, I'd say it's a little easier to find info on javascript online than it is ruby.
What was something you needed to do independent research on for this project? What did you learn? I did a lot of research on javascript built in method, mostly for strings and arrays.
What was a challenge you were able to overcome on this assignment? for me, figuring out how to account for ties in scoring was kind of a long and involved process that required a lot of research and debugging, but I really liked how it turned out.
What has been interesting and positive about learning a new programming language? There's a lot of info online and there's also a lot of cool things you can do with it.
What is something to focus on your learnings in JavaScript in the next week? Javascript classes, as well as more research on closures. Closures seem really cool and helpful and somewhat complex.

@beccaelenzil beccaelenzil 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. ✔️
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

Great work on this project! In this project you’ve taken some interesting logic and worked it into JavaScript syntax. Your code is clever and logical. Nice work!

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
Concise
Logical/Organized

Comment thread src/adagrams.js
@@ -1,7 +1,107 @@
const letterPool = {
A: [9, 1],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I like how you stored the frequency and scores together to DRY up your code.

Comment thread src/adagrams.js

usesAvailableLetters(word, hand = drawLetters()) {
// if letter is found in hand, the search continues at an incremented index. this way a letter in hand cant be counted twice
return word.toUpperCase().split('').every(( index => letter => index = hand.indexOf(letter, index) + 1)(0));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wow. This is a lot on one line. Looks slick, but at the same time, consider splitting up this logic to enhance readability.

Comment thread src/adagrams.js
Comment on lines +89 to +99
for (const word of tiedWords) {
if (word.length === 10) {
winningIndex = tiedWords.indexOf(word);
highestScore = {score: scores[indices[winningIndex]], word: tiedWords[winningIndex]};
return highestScore;
} else {
if (word.length < shortest.length) {
shortest = word;
shortestIndex = tiedWords.indexOf(shortest);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider breaking out this logic into a helper method such as tieBreaker

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