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

game_operation.py #30

Open JiggsUK opened 5 years ago

JiggsUK commented 5 years ago

Covers the setup of the game board and functions that require user input.

Function: current_game_state Purpose: Allows user to enter the current state of play in their game Acceptance Criteria:

  1. Prompt user to enter any words that have already been played a. consider how to locate where the word should go on the board
  2. In addition to the word_validation checks, also need more validation of word input that includes checking: a. start/stop location is not off the board b. the word will fit in the location the user gives
  3. This will need to allow user to stop entering non-scoring words so they can move on to the word they want scored

Function: score_calculator Purpose: Asks for word to be scored and location, validates it, checks for perpendicular words on the board and multipliers, calls multiplier_score to calculate Acceptance Criteria:

  1. Calculates score of any word formed additionally to the selected word.
  2. Must account for any multiplier tiles.
  3. Returns total score of perpendicular words formed, which can be added to the word score to form the total score for the given word

Function:perpendicular_word_finder Purpose: Finds any additional words that are formed from placing the user word. Acceptance Criteria:

  1. Returns collection of additional perpendicularly formed words for use in score calculation.
JiggsUK commented 5 years ago

I'll make a couple of suggestions for current_game_state 1a to get the ball rolling:

  1. use letter/number to indicate start and end - i.e. start = A1, end = A6
  2. start location then direction of word – horizontal/ vertical - i.e. start = A1 dir = horizontal so word is placed that way
webdotorg commented 5 years ago

For this issue, a user should be given a random tiles. Seven, I believe. They should have the same number of tiles at all times. We will need a custom sort function which will build on or previously written text code which simply evaluated a text score. Let's say I'm playing from the word PHOTO: I have ABCGRAPH. The best word is PHOTOGRAPH. This should--at the very least--evaluate the score and give you the option to play the word using buttons. Words should be played perpendicularly and horizontally. When calculating scores: If 'P' in the word PHOTO is a double word score, the score is double. Rules must be followed likewise.