-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Michelle & Aurea - Edges - Adagrams #8
base: master
Are you sure you want to change the base?
Conversation
AdagramsWhat We're Looking For
Great work y'all! The code looks great, works great, and meets all the requirements. It's very readable! Not a huge comment, but y'all could probably do with less comments -- maybe the comments I appreciated were the more nuanced decisions like the hash for the optional wave 5. I didn't quite need comments for the obvious stuff. Your implementation of I love the use of the hash for the dictionary so accessing it would be more efficient. In the future, if you have to do a weird data structure like this, instead of setting the value to Also, the tests for the optional wave look great. I don't have any more comments on this code -- great work overall :) |
# draw letters | ||
|
||
# letter pool | ||
pool = ('A'*9 + 'B'*2 + 'C'*2 + 'D'*4 + 'E'*12 + 'F'*2 + 'G'*3 + 'H'*2 + 'I'*9 + 'J' + 'K' + 'L'*4 + 'M'*2 + 'N'*6 + 'O'*8 + 'P'*2 + 'Q' + 'R'*6 + 'S'*4 + 'T'*6 + 'U'*4 + 'V'*2 + 'W'*2 + 'X' + 'Y'*2 + 'Z').chars |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 👍
|
||
# made a clone of letters; previously, we ran into memory location/duplication issues | ||
# we don't want to alter letters since it needs to reset with all 10 pulled letters available upon each call | ||
letters_copy = letters.clone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll talk about reference vs. value in class formally soon. But also, I'm pretty curious, what side effects did you see if you didn't make a copy of letters
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you input in an incorrect word, and then on the second try input in a valid word using any of the same letters, the program will not recognize it as valid because it modifies the hand of letters after the first attempt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm remembering correctly, we had the following issue if we didn't make a copy: if someone drew the letters "a", "b", "c", "d", "e", "f" for example and made the nonsense word "abc" then they would be asked to try again. But "a", "b", and "c" would have been mistakenly deleted from the list, leaving only "d", "e", and "f". So if they next tried the word "cab" they would get an error message. We also tried letters_copy = letters, but I think we figured out that they're pointing to the same place in memory because the "copy" would have the same issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right! Got it, makes sense. Thanks!
Thanks, Dee! Not sure you can see this, but I'm the one who overdid the comments! I'm always afraid I won't know what my code is doing if I look at it months from now. I'd love to have a conversation with you about when comments should/shouldn't be added. Thanks again for your helpful feedback. |
Adagrams
Congratulations! You're submitting your assignment.
Comprehension Questions
Enumerable
mixin? If so, where and why was it helpful?