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 |
|
|
||
| # 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.
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.
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.
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.
|
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
Enumerablemixin? If so, where and why was it helpful?