Skip to content

Conversation

emilyvomacka
Copy link

JS Adagrams

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? Used knowledge of data structures, basic array handling and conditionals.
Did you need to use different strategies to find information online about JavaScript than you would for Ruby? Stuck more to the official MDN docs when I could.
What was a challenge you were able to overcome on this assignment? Struggles with for...in vs for...of loop, which required lots of debugging.
What has been interesting and positive about learning a new programming language? Realizing how many concepts apply to many different syntaxes.
What is something to focus on your learnings in JavaScript in the next week? Getting comfortable with living in a literal bracket forest.


const letterHand = [];

letterHandIndices.forEach( function(index) {

Choose a reason for hiding this comment

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

consider using an arrow function for the anonymous function in the forEach loop

const letterPool = ('A'.repeat(10) + 'B'.repeat(2) + 'C'.repeat(2) + 'D'.repeat(4) + 'E'.repeat(12) + 'F'.repeat(2) + 'G'.repeat(3) + 'H'.repeat(2) + 'I'.repeat(9) + 'J' + 'K' + 'L'.repeat(4) + 'M'.repeat(2) + 'N'.repeat(6) + 'O'.repeat(8) + 'P'.repeat(2) + 'Q' + 'R'.repeat(6) + 'S'.repeat(4) + 'T'.repeat(6) + 'U'.repeat(4) + 'V'.repeat(2) + 'W'.repeat(2) + 'X' + 'Y'.repeat(2) + 'Z').split('');

const letterHandIndices = [];
do {

Choose a reason for hiding this comment

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

Love the use of the do-while! :)

@@ -1,8 +1,83 @@
const Adagrams = {
drawLetters() {
// Implement this method for wave 1
const letterPool = ('A'.repeat(10) + 'B'.repeat(2) + 'C'.repeat(2) + 'D'.repeat(4) + 'E'.repeat(12) + 'F'.repeat(2) + 'G'.repeat(3) + 'H'.repeat(2) + 'I'.repeat(9) + 'J' + 'K' + 'L'.repeat(4) + 'M'.repeat(2) + 'N'.repeat(6) + 'O'.repeat(8) + 'P'.repeat(2) + 'Q' + 'R'.repeat(6) + 'S'.repeat(4) + 'T'.repeat(6) + 'U'.repeat(4) + 'V'.repeat(2) + 'W'.repeat(2) + 'X' + 'Y'.repeat(2) + 'Z').split('');

Choose a reason for hiding this comment

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

Style note: Consider giving each letters it's own line.

const lettersInHandCopy = Array.from(lettersInHand);
const inputArray = input.split('');
let validHand = true
inputArray.forEach( function(char) {

Choose a reason for hiding this comment

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

consider refactoring to a different type of loop so that you could return false as soon as it's encountered.

}
}
});
if (wordArray.length > 6) {

Choose a reason for hiding this comment

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

&& wordArray.length < 11

return validHand
},

highestScoreFrom(words) {

Choose a reason for hiding this comment

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

style note: even though it's not required, placing score(word) above highestScoreFrom(words) is best practice since the later function uses the former.

@beccaelenzil
Copy link

JS Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions yes
Small commits with meaningful commit messages yes
Code Requirements
drawLetters method
Uses appropriate data structure to store the letter distribution see comment
All tests for drawLetters pass yes
usesAvailableLetters method
All tests for usesAvailableLetters pass yes
scoreWord method
Uses appropriate data structure to store the letter scores yes
All tests for scoreWord pass yes
Optional
highestScoreFrom method
Appropriately handles edge cases for tie-breaking logic yes
All tests for highestScoreFrom pass yes
Overall Great work overall! In this project you’ve taken some interesting logic and worked it into JavaScript syntax. I've left a few comments for you to review, but overall you’ve done a great job of practicing syntax.

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