/scrabble_Py_3

Python 3 practice. Use dictionaries to organize players, words, and points from data from a group of friends playing scrabble.

Primary LanguagePython

scrabble_Py_3

Python 3 practice. Use dictionaries to organize players, words, and points from data from a group of friends playing scrabble.

General info

The purpose of the project is just personal learning.

Description

  • There are two lists, letters and points and then dictionary called letter_to_points that maps each letter to its point value.
  • A dictionary letters_to_points is created from these lists, using zip comprehension, and an additional key:value is added to account for blank tiles.
  • The function score_word takes in a word and return how many points that word is worth.
  • A dictionary player_to_words maps players to a list of the words they have played.
  • An originally empty dictionary player_to_points will be filled in a double loop, with player name value as key and a value of player_points.
    • The outer loop iterates through the items in player_to_words (player is player and each list of words is words)
    • The inner loop uses a variable called player_points (set to 0) will add the score per word passed using function score_word() with word as input.

To-do list:

  • Add a function play_word() that would take in a player and a word, and add that word to the list of words they’ve played
  • Add a funciton update_point_totals() to turn the nested loops into a function that you can call any time a word is played

Technologies

  • Python 3

Setup

NA - It's only coding examples, there's no setup.

Status

Project is: finished, - But I didn't do the extra activities.

References

Based on Codecademy's Learn Python 3 course