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

No description provided.

Copy link

@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!

def uses_available_letters(word, letter_bank):
pass

copy_letter_bank = letter_bank.copy()

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!

# Invoking this function should not change the pool of letters

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

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!


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

Choose a reason for hiding this comment

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

Excellent use of .sum()

def score_word(word):
pass

letters_and_point_values = {

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!


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

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!

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)

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()!

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

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