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

Kunzite - Abby Castillo #126

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

abbymachines
Copy link

No description provided.

Copy link

@marciaga marciaga left a comment

Choose a reason for hiding this comment

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

Good job overall! I left a few comments inline for you to review.


def score_word(word):
pass
score = 0
Copy link

Choose a reason for hiding this comment

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

Nice job here, this will score the word according to the letter to point value mapping, however the requirements for Wave 03 also state: "If the length of the word is 7, 8, 9, or 10, then the word gets an additional 8 points", which this function doesn't account for.


import random

LETTERS_TUPLE = ( {'A': 9,
Copy link

Choose a reason for hiding this comment

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

Interesting choice of data structure! Since in the next line of you index this nested dictionary out of the tuple, it's not clear why the nesting in the first place - you could use a dictionary and bypass the need to index a tuple!


# helper functions

def make_letter_pool_list(letter_frequencies):
Copy link

Choose a reason for hiding this comment

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

Cool helper function, this will help ensure the letter pool distribution is accounted for!


def uses_available_letters(word, letter_bank):
pass
hand = list(letter_bank)
Copy link

Choose a reason for hiding this comment

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

letter_bank is already a list, so no need to convert to a list.

if letter not in hand:
return False
elif letter in hand:
hand.remove(letter)
Copy link

Choose a reason for hiding this comment

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

No need to remove the letter from the hand on this implementation. All you're concerned with is checking whether the letter is not in the hand. If you iterate over all the letters and find that all of them are in the hand, you can just return True.

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