We start describing the (basic) rules of the game. It is a Scrabble-like game for a single player. Letters are dealt to players, who then construct one or more words using their letters. Each valid word earns the user points, based on the length of the word and the letters in that word.
The specific rules are as follows:
-
Dealing and Playing
-
A player is dealt a hand of
HAND_SIZE
letters of the alphabet, chosen at random with rules on the distribution of consonants, vowels and jokers. This may include multiple instances of a particular letter -
The player arranges the hand into as many words as they want out of the letters, but using each letter at most once.
-
Some letters may remain unused, though the size of the hand when a word is played does affect its score.
-
-
Scoring
-
The score for the hand is the sum of the score for each word formed.
-
The score for a word is the product of two components:
- First component: the sum of the points for letters in the word.
- Second component:
max(7wl − 3(n − wl), 1)
;wl
is the number of letters used in the word andn
is the number of letters available in the current hand.
-
Letters are scored as in Scrabble; a is worth 1, b is worth 3, c is worth 3, d is worth 2, e is worth 1, and so on. We already have defined the dictionary
SCRABBLE_LETTER_VALUES
with those values for you. -
Example: If
n
= 6 and the hand includes 1 w, 2 e, and 1 d (as well as two other letters), playing the word weed would be worth 176 points: (4 + 1 + 1 + 2) · (7·4 − 3·(6 − 4)) = 176. The first term is the sum of the values of each letter used; the second term is the special computation that rewards a player for playing a longer word, and penalizes them for any left over letters.
-