Learning-Python-Team / word-game-tool

Basic tool to help players of word games, based around Scrabble, find the score of their words and assist them selecting the optimal word
MIT License
7 stars 8 forks source link

score_calculator.py (prev. word_to_score.py) #31

Open JiggsUK opened 5 years ago

JiggsUK commented 5 years ago

The char_dict should be made global so it is accessible to all the functions.

Function: base_score ---> renamed from point_conversion Purpose: Calculates base score of a given word Acceptance Criteria:

  1. Returns base score of the word.

Function: multiplier_score Purpose: Calculates score of a given word including any letter/word tiles multipliers passed Acceptance Criteria:

  1. Returns total score of the word
  2. Must account for any multiplier tiles.
nakulkd commented 5 years ago

I see that the char_dict has an item as '*': 0.

I don't think * should be an acceptable user input and I believe this was patched in Phase 1. So before I remove this, just wanted to check with the group if there is a Scrabble rule I'm missing or if I can remove this in the code I'm building?

EDIT: I see the * has a reference in valid_word_check.py, however, my understanding is that the function replaces it with a suitable letter from the list so it wouldn't be scored anyway. I'm new to this stuff so I may be completely off on this so please bear with me.

Thanks!

asa-holland commented 5 years ago

Sure! Scrabble has a 'blank' tile that can represent any letter but contributes zero points to the score. On a previous issue we discussed how best to represent blank tiles and decided on allowing the user to enter * in place of a blank.

nakulkd commented 5 years ago

Ah that makes sense! I was under the impression the letter chosen in place of the blank tile would also carry the score with it. Thanks for clearing that up!

nakulkd commented 5 years ago

Raised a pull request to the phase-2-dev branch from my fork. Thanks for looking into it!

First pull request so I hope the pull process was right. If not, do let me know what needs to be changed.

EDIT: GitHub is not letting me move this issue to In Progress in the Projects tab. Could be a permissions challenge.

Thanks & Regards, Nakul K D

JiggsUK commented 5 years ago

Looks good Nakul!