Skip to content

Pine C16 Eunice & Lilly#30

Open
eunicegore wants to merge 15 commits intoAda-C16:masterfrom
eunicegore:master
Open

Pine C16 Eunice & Lilly#30
eunicegore wants to merge 15 commits intoAda-C16:masterfrom
eunicegore:master

Conversation

@eunicegore
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Collaborator

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Nice work. All the functions worked and, you hit the learning goals here. I had a few comments to make the code a bit more streamlined, but it all works. Well done.

Comment thread adagrams/game.py
@@ -1,11 +1,93 @@
import random
def draw_letters():
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍
Nice work!

Comment thread adagrams/game.py
return tile_list


def uses_available_letters(word, letter_bank):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍 Nice work, this is a clever way to solve this.

Comment thread adagrams/game.py
Comment on lines +35 to +41
value1=["A","E","I","O","U","L","N", "R", "S", "T"]
value_2=["D", "G"]
value_3=["B", "C", "M", "P"]
value_4=["F", "H", "V", "W", "Y"]
value_5=["K"]
value_8=["J", "X"]
value_10=["Q", "Z"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This works, but It involves a lot of hardcoded if statements. This could also be solved with a dictionary, using either a set of letters as values and scores as values, or individual letters as keys and points as values.

For example

    letter_scores = {
        {"A","E","I","O","U","L","N", "R", "S", "T"}:  1,
        {"D", "G"}: 2,
        ...

Or:

    letter_scores = {
        'A': 1,
        'B': 3,
        'C': 3,
        ...

Then you can solve the problem with a more compact loop.

Comment thread adagrams/game.py
total+=8
return(total)

def get_highest_word_score(word_list):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Clever use of max and min to determine the winner.

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.

3 participants