Question: i want the answer in python. Scrabble is a board game in which players take turns spelling words for points. Each letter has a point

 i want the answer in python. Scrabble is a board game

in which players take turns spelling words for points. Each letter has

a point value, word scores are made up of the sum of

letter scores, and multipliers can be applied if a letter or word

lands on particular spaces on the board (as shown in the figure

below). Different letters are worth different numbers of points in Scrabble. The

distribution of these letters is given in this Wikipedia article; we will

i want the answer in python.

Scrabble is a board game in which players take turns spelling words for points. Each letter has a point value, word scores are made up of the sum of letter scores, and multipliers can be applied if a letter or word lands on particular spaces on the board (as shown in the figure below). Different letters are worth different numbers of points in Scrabble. The distribution of these letters is given in this Wikipedia article; we will use the English letter distribution. You will need to write a Python function that, when given a letter, returns the number of points associated with that letter. For example, the letter A is worth 1 point, whereas the letter Z is worth 10. Points are scored in Scrabble by playing words. The score of a word, absent any multipliers (described below), is the sum of its letters' points. For example, the word APPLE would score 9 points. A standard Scrabble board f. t P www jovi 693 -934 3 lg g V S TRIPLE WORD SCORE DOUBLE LETTER SCORE TRIPLE WORD SCORE AA CE DOUBLE WORD SCORE TRIPLE LETTER SCORE R, DOUBLE WORD SCORE DOUBLE LETTER SCORE 1 DOUBLE LETTER SCORE DOUBLE WORD SCORE A, DOUBLE LETTER SCORE 1 DOUBLE WORD SCORE B, TRIPLE LETTER SCORE TRIPLE LETTER SCORE B 3 DOUBLE LETTER SCORE DOUBLE LETTER SCORE L 1 TRIPLE WORD SCORE DOUBLE LETTER SCORE E 1 DOUBLE LETTER SCORE DOUBLE LETTER SCORE REGO TRADE MARK TRIPLE LETTER SCORE LETTER SCORE LETTER DISTRIBUTION DOUBLE WORD SCORE A-9 B-2 S-4 T-6 K-1 L-4 M-2 N-6 0-8 P-2 DOUBLE LETTER SCORE DOUBLE WORD SCORE DOUBLE LETTER SCORE D-4 E-12 F-2 G-3 H-2 1-9 V-2 W-2 X-1 Y-2 z DOUBLE WORD SCORE DOUBLE LETTER SCORE R-6 BLANK-2 DOUBLE WORD SCORE TRIPLE LETTER SCORE COPYRIGHT 1954 & US COPYRIGHT 1948 by PRODUCTION AND MARKETING COMPANY . TRIPLE WORD SCORE DOUBLE LETTER SCORE TRIPLE WORD SCORE NEWTOWN CONN. SCR A B MADE IN ENGLAND Multipliers If a word crosses any of the coloured spaces on the game board, letter or word scores can be doubled or even tripled. For the purposes of this assignment, we will only consider word multipliers, which are: Triple word score Locations (0,0), (0,7), (0,14), (7,0), (7,7), (7,14), (14,0), (14,7), (14,14) Double word score Locations (1,1), (1, 13), (2,2), (2, 12), (3,3), (3, 11), (4,4), (4, 10), (10,4), (10, 10), (11,3), (11, 11), (12,2), (12, 12), (13,1), (13, 13) Thus, if the word APPLE is played from left to right at location (0,6), it wiill be worth 27 points (9 * 3) because one of its tiles is on a triple word score tile at (0,7). As another example, if the word PYTHON is spelled from top to bottom at location (2,0), it should score 42 points (14 x 3) because one of its tiles is on a triple word score tile at (7,0). def letter_Score(letter): II II II This function should return the nu the letter 'letter IIIIII pass # replace this with your For example, letter_score('A') should return 1 andi letter_score('Z') should return 10. Words Use the description above to complete the following Python function that calculates a word's point value. def word_score (word, row=None, col=Nor II II II Compute the points that will be so Parameters: word row the word to be pl which row the wor which column the 'LR' for left-to- col direction Completing the assignment Implement the two functions above and submit your work in a file called scrabble.py. You may start by copying the stub implementations above into your Python file to help you get started. Then, follow our usual problem-solving approach (problem, pseudocode, Python) for each part of the assignment (letters, words, words with positions). I suggest that you work on one part at a time: 1. First, implement letter_score() 2. Next, implement word_score() while ignoring row, col and direction 3. Finally, take row, col and direction into account within word_score() 0 1 2 3 4 5 6 7 0 1 2 P 3 4 >I|IO 5 6 7 IN Requirements In this assignment, you must implement two Python functions, one to compute the score of a single letter and one to compute the score of a word. Single letters Use the points distribution referenced above to implement the following Python function: def letter_score(letter): II II II This function should return the nu the letter 'letter'. II II II pass # replace this with your If any of row, col or direction are None, all of them should be; this means that you can ignore the word's placement. For example, the function call word_score('APPLE') should evaluation to 9. If any of row, col or direction are non-None, however, they should all be. In this case, you should take them all into account and apply any appropriate multipliers. For example, word_score('APPLE', 0, 6, 'LR') should evaluation to 27 (as described above). Completing the assignment Implement the two functions above and submit your work in a file called scrabble.py. You may start by copying the stub implementations above into your Python file to help you get started. Then, follow our usual problem-solving approach (problem, pseudocode, Python) for each part of the assignment (letters, words, words with positions). I suggest that you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!