-
Couldn't load subscription status.
- Fork 29
Ports - Kim & Ari #1
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
base: master
Are you sure you want to change the base?
Conversation
AdagramsWhat We're Looking For
|
| def draw_letters | ||
|
|
||
| # hash that store letters and their quantities | ||
| letter_pool = { |
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.
Good structure 👍
|
|
||
| # for each key in the pool, add the key in the quantity of its value into the letter_pool_array array | ||
| letter_pool.each do |letter, quantity| | ||
| letter_pool_array.fill(letter.to_s, letter_pool_array.size, quantity) |
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 use of fill
|
|
||
| # pushes true/false values into an array based on if user input is valid | ||
| true_false = [] | ||
| split_input.each do |letter| |
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.
I would suggest that if you ever encounter a letter not in the hand, that you can then return false.
Good catch in checking the count of the letter in the hand and the count of the letter in the input
| # method that calculates an input word's total score | ||
| def score_word(word) | ||
| # hash with arrays as values, to store our score chart | ||
| score_chart = { |
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.
The structure to store the letters mapped to scores, works.
| require "csv" | ||
|
|
||
| def is_in_english_dict?(input) | ||
| dictionary = CSV.read("../assets/dictionary-english.csv") |
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're running this from the root directory of the project this should be:
dictionary = CSV.read("assets/dictionary-english.csv"
Adagrams
Congratulations! You're submitting your assignment.
Comprehension Questions
Enumerablemixin? If so, where and why was it helpful?