Skip to content

water - marj#43

Open
Schmarj3 wants to merge 1 commit into
Ada-C14:masterfrom
schmarj3-learning-projects:master
Open

water - marj#43
Schmarj3 wants to merge 1 commit into
Ada-C14:masterfrom
schmarj3-learning-projects:master

Conversation

@Schmarj3

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? case statements
Did you need to use different strategies to find information online about JavaScript than you would for Ruby? no, just good ol' google
What was something you needed to do independent research on for this project? What did you learn? js splice method, and honestly I think I should have looked into more of js methods for different datatypes that already exist and tried to use those more.
What was a challenge you were able to overcome on this assignment? The TIES~ took me a bit of time to get the logic to pass the tests.
What has been interesting and positive about learning a new programming language? Seeing a different yet somewhat similar way to approach the same problems
What is something to focus on your learnings in JavaScript in the next week? learn more about js methods

@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. inconsistient ;'s
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 +36 to +48
for (let i = 0; i < 10; i++) {
let letter = letterDistribution.pickRandomLetter();

while(letterDistribution[letter] === 0) {
letter = letterDistribution.pickRandomLetter();
}

lettersDrawn.push(letter);
letterDistribution[letter] -= 1;
}

return lettersDrawn;
},

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 doesn't actually create a weighted distribution. You are essentially picking from a pile 26 options, and then reducing the number of times that someone can draw that letter, which is mathematically different than having a pile that has a hundred or so tiles and just one 'Q'.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oh no... >_< I'm not sure I understand what you mean or what I should have done differently to use weighted distribution. I am googling its meaning~! Are you saying I should rename my variables or change my function???

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ok, so should I have made an object with the total amount of tiles for the all the letters and then give each letter a unique number.. like instead of {A:9, B:2} for a total of 11 tiles, should I have done {A:1, A:2, A:3...B:10, B:11}???

Comment thread src/adagrams.js
Comment on lines +51 to 63
let allLettersIncluded = true

for(let letter of input){
if (lettersInHand.includes(letter)){
let letterToRemove = lettersInHand.indexOf(letter);
lettersInHand.splice(letterToRemove, 1)
} else {
allLettersIncluded = false;
break;
}
}
return allLettersIncluded
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You're about 50/50 for semicolons in this function.

Suggested change
let allLettersIncluded = true
for(let letter of input){
if (lettersInHand.includes(letter)){
let letterToRemove = lettersInHand.indexOf(letter);
lettersInHand.splice(letterToRemove, 1)
} else {
allLettersIncluded = false;
break;
}
}
return allLettersIncluded
},
let allLettersIncluded = true;
for(let letter of input){
if (lettersInHand.includes(letter)){
let letterToRemove = lettersInHand.indexOf(letter);
lettersInHand.splice(letterToRemove, 1);
} else {
allLettersIncluded = false;
break;
}
}
return allLettersIncluded;
},

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