Skip to content
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

Sockets - Bita and Maria #25

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

MariaWissler
Copy link

Adagrams

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
What are the components that make up a method? Signature and body
What are the advantages of using git when collaboratively working on one code base? Work in progress
What kind of relationship did you and your pair have with the unit tests?
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? yes , it was interesting to see some of them were able to mix, specially for the scoring
What was one method you and your pair used to debug code? went to the code line by line, connecting what was happening in the code, and what methods were returning
What are two discussion points that you and your pair discussed when giving/receiving feedback from each other that you would be willing to share? Work in Progress

@kaidamasaki
Copy link

kaidamasaki commented Mar 4, 2019

Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions Partial
Small commits with meaningful commit messages Small commits
Code Requirements
draw_letters method
Uses appropriate data structure to store the letter distribution
All tests for draw_letters pass
uses_available_letters? method
All tests for uses_available_letters? pass
score_word method
Uses appropriate data structure to store the letter scores
All tests for score_word pass
highest_score_from method
Appropriately handles edge cases for tie-breaking logic
All tests for highest_score_from pass
Overall Good job! Aside from one minor bug (that wasn't in the tests) everything worked perfectly. :) I would like to see more descriptive commit messages. Your commits should tell the reader a story about what changed when and why, without them having to dig through the code or project requirements.

@@ -0,0 +1,12 @@
# wirte a method with no parameters

Choose a reason for hiding this comment

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

In the future make sure to clean up files you aren't using.

if index.nil?
return false
else
letters_in_hand.delete_at(index)

Choose a reason for hiding this comment

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

Because this deletes letters as it finds them if the user inputs an invalid word the letters it does use will be deleted.

For example:

$ ruby wave-2-game.rb
Welcome to Adagrams!
Let's draw 10 letters from the letter pool...
You have drawn the letters:
N, K, E, I, W, V, R, A, A, E
Please input a word that only uses the letters from the letter bank
NAAA
You entered in a word that contains characters not in the letter bank
Please input a word that only uses the letters from the letter bank
NA
You entered in a word that contains characters not in the letter bank
Please input a word that only uses the letters from the letter bank

end

scores_hash = Hash[words.zip scores]
puts "scores_hash #{scores_hash}"

Choose a reason for hiding this comment

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

In the future you should remove debugging puts before submitting an assignment.

Leaving the puts in means the user will see extra output when they try to play the game.

$ ruby wave-4-game.rb
Welcome to Adagrams!
Let's draw 10 letters from the letter pool...
You have drawn the letters:
L, E, M, G, E, F, O, N, D, R
Please input your submission for the longest anagram you can come up with
LEMG
Your submitted anagram scored 7 points
Should we play another round?
Enter y to replay
y
Let's draw 10 letters from the letter pool...
You have drawn the letters:
O, P, Z, E, E, O, D, J, H, T
Please input your submission for the longest anagram you can come up with
OPZEE
Your submitted anagram scored 16 points
Should we play another round?
Enter y to replay

scores_hash {"LEMG"=>7, "OPZEE"=>16}
winner_score {"OPZEE"=>16}
winner_score.length 1
Thanks for playing Adagrams!
The highest score from this game was OPZEE, which was worth 16 points
Goodbye!

puts "scores_hash #{scores_hash}"
winner_score = scores_hash.select { |_key, value| value == scores_hash.values.max }
puts "winner_score #{winner_score}"
puts "winner_score.length #{winner_score.length}"

Choose a reason for hiding this comment

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

Remove debugging puts.

elsif long_words.length > 1
winner = long_words[0]
else
short_words = winner_score.min_by { |key, _value| key.length }

Choose a reason for hiding this comment

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

Try to use more descriptive names. For example in this case you could do something like:

short_words = winner_score.min_by { |word, _score| word.length }

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