Skip to content

C17 Whales Adagrams - Natascha Jenkins, Mandy Gao, Morgan Adkisson#42

Open
MorganAdkisson wants to merge 21 commits intoada-c17:masterfrom
MorganAdkisson:master
Open

C17 Whales Adagrams - Natascha Jenkins, Mandy Gao, Morgan Adkisson#42
MorganAdkisson wants to merge 21 commits intoada-c17:masterfrom
MorganAdkisson:master

Conversation

@MorganAdkisson
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@jericahuang jericahuang left a comment

Choose a reason for hiding this comment

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

Great work on this project, Natascha, Mandy and Morgan! The code you wrote together both passed all the tests and met the learning goals. I see awesome git collaboration from the commit history and I made line-by-line notes of great highlights I saw. You all have earned a 🟢 on Adagrams!

Comment thread adagrams/game.py
def uses_available_letters(word, letter_bank):
pass

copy_letter_bank = letter_bank.copy()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice use of .copy() to avoid side effects!

Comment thread adagrams/game.py
# Invoking this function should not change the pool of letters

all_letters = []
letter_a = all_letters.extend(repeat('A', 9))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very cool letters pool implementation using repeat!

Comment thread adagrams/game.py

if len(word.upper()) >= 7 and len(word.upper()) <= 10:
return (sum(points_for_each_letter)+bonus)
else:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Excellent use of .sum()

Comment thread adagrams/game.py
def score_word(word):
pass

letters_and_point_values = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A dict is a great data type to track the letter and point values!

Comment thread adagrams/game.py

def get_highest_word_score(word_list):
pass No newline at end of file
scores = [score_word(word) for word in word_list]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Lovely list comprehension and helper function usage!

Comment thread adagrams/game.py
def get_highest_word_score(word_list):
pass No newline at end of file
scores = [score_word(word) for word in word_list]
word_and_score = sorted(list(zip(word_list, scores)), reverse = True)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wonderful use of .sorted(), .list(), and .zip()!

Comment thread tests/test_wave_04.py
assert best_word[1] == 18

def test_get_highest_word_tie_prefers_shorter_word_our_test():
#tests for shortest word indepedent of position in alphabet
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice test addition!

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.

4 participants