Skip to content

Earth - Emily#29

Open
emirry wants to merge 9 commits into
Ada-C14:masterfrom
emirry:master
Open

Earth - Emily#29
emirry wants to merge 9 commits into
Ada-C14:masterfrom
emirry:master

Conversation

@emirry

@emirry emirry commented Dec 13, 2020

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 felt like the logic to create new functions/methods and invoking those functions/methods shared similar patterns.
Did you need to use different strategies to find information online about JavaScript than you would for Ruby? I feel like my google searches became better than when I first learned Ruby. Felt more efficient this time.
What was something you needed to do independent research on for this project? What did you learn? I had to research how to work with objects. I learned how to make copies of objects and how to loop through multiple for loops as well.
What was a challenge you were able to overcome on this assignment? It took awhile to figure out the syntax for JavaScript, but once I got past the first wave it got easier.
What has been interesting and positive about learning a new programming language? So far everything's been positive. I've heard many programmers say that the second language is somewhat easier to learn. Now I understand why that is, which is a great feeling.
What is something to focus on your learnings in JavaScript in the next week? My focus was to learn how to write functions and to understand how to iterate through loops.

@dHelmgren dHelmgren 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

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 5+ in Code Review && 3+ in Functional Requirements ✔️
Yellow (Approaches Standards) 4+ in Code Review && 2+ in Functional Requirements, or the instructor judges that this project needs special attention
Red (Not at Standard) 0-3 in Code Review or 0,1 in Functional Reqs, or assignment is breaking/doesn’t run with less than 5 minutes of debugging, or the instructor judges that this project needs special attention

Comment thread src/adagrams.js
Comment on lines +44 to +53
const letterPool = [];
for (const letter in this.letterDistribution) {
for (let counter = 0; counter < this.letterDistribution[letter]; counter++) {
this.letterPool.push(letter);
}
}
const randomNumber = Math.floor(Math.random() * this.letterPool.length);
const letter = this.letterPool[randomNumber];

return letter;

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 returns a randomized letter each time, rather than a pool that we can pull letters from and modify as we go. Each time we pull a letter with this method, we end up with the same chance of getting any given letter, so even though the letter pool has only 1 Q, it's possible (however unlikely) that we end up with a hand that only has Q's in it.

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