Skip to main content
Commonmark migration
Source Link

Bugs

#Bugs II think the calculation is incorrect when there's both letter multipliers and word multipliers in play - the letter multipliers should be computed first, so that they get multiplied up by the word multiplier, too.

It also doesn't handle words that span more than one double-word or triple-word square, or claiming the 50-point bonus for playing all tiles.

#Improvements

Improvements

This line, as well as being unwieldy (use some line breaks!) restricts this program to English scrabble:

letter_val = {" ": 0, "A": 1, "B": 3, "C": 3, "D": 2, "E": 1, "F": 4, "G": 2, "H": 4, "I": 1, "J": 8, "K": 5, "L": 1, "M": 3, "N": 1, "O": 1, "P": 3, "Q": 10, "R": 1, "S": 1, "T": 1, "U": 1, "V": 4, "W": 4, "X": 8, "Y": 4, "Z": 10}

If you want to be useful to all players of the game, it would be worth loading the points values from a config file.

The current code is going to have problems in languages where not all tiles are single letters (e.g. DD₁ or LL₅ in a Welsh set).

If you ever try Super Scrabble, you'll find that there are quad-letter and quad-word spaces, too; it would be a nice enhancement to support those, and not too difficult to implement.

#Bugs I think the calculation is incorrect when there's both letter multipliers and word multipliers in play - the letter multipliers should be computed first, so that they get multiplied up by the word multiplier, too.

It also doesn't handle words that span more than one double-word or triple-word square, or claiming the 50-point bonus for playing all tiles.

#Improvements

This line, as well as being unwieldy (use some line breaks!) restricts this program to English scrabble:

letter_val = {" ": 0, "A": 1, "B": 3, "C": 3, "D": 2, "E": 1, "F": 4, "G": 2, "H": 4, "I": 1, "J": 8, "K": 5, "L": 1, "M": 3, "N": 1, "O": 1, "P": 3, "Q": 10, "R": 1, "S": 1, "T": 1, "U": 1, "V": 4, "W": 4, "X": 8, "Y": 4, "Z": 10}

If you want to be useful to all players of the game, it would be worth loading the points values from a config file.

The current code is going to have problems in languages where not all tiles are single letters (e.g. DD₁ or LL₅ in a Welsh set).

If you ever try Super Scrabble, you'll find that there are quad-letter and quad-word spaces, too; it would be a nice enhancement to support those, and not too difficult to implement.

Bugs

I think the calculation is incorrect when there's both letter multipliers and word multipliers in play - the letter multipliers should be computed first, so that they get multiplied up by the word multiplier, too.

It also doesn't handle words that span more than one double-word or triple-word square, or claiming the 50-point bonus for playing all tiles.

Improvements

This line, as well as being unwieldy (use some line breaks!) restricts this program to English scrabble:

letter_val = {" ": 0, "A": 1, "B": 3, "C": 3, "D": 2, "E": 1, "F": 4, "G": 2, "H": 4, "I": 1, "J": 8, "K": 5, "L": 1, "M": 3, "N": 1, "O": 1, "P": 3, "Q": 10, "R": 1, "S": 1, "T": 1, "U": 1, "V": 4, "W": 4, "X": 8, "Y": 4, "Z": 10}

If you want to be useful to all players of the game, it would be worth loading the points values from a config file.

The current code is going to have problems in languages where not all tiles are single letters (e.g. DD₁ or LL₅ in a Welsh set).

If you ever try Super Scrabble, you'll find that there are quad-letter and quad-word spaces, too; it would be a nice enhancement to support those, and not too difficult to implement.

Scrabble operator precedence; quad letter/word suggestion; re-order with bugs first
Source Link
Toby Speight
  • 81.7k
  • 14
  • 101
  • 308

#Bugs I think the calculation is incorrect when there's both letter multipliers and word multipliers in play - the letter multipliers should be computed first, so that they get multiplied up by the word multiplier, too.

It also doesn't handle words that span more than one double-word or triple-word square, or claiming the 50-point bonus for playing all tiles.

#Improvements

This line, as well as being unwieldy (use some line breaks!) restricts this program to English scrabble:

letter_val = {" ": 0, "A": 1, "B": 3, "C": 3, "D": 2, "E": 1, "F": 4, "G": 2, "H": 4, "I": 1, "J": 8, "K": 5, "L": 1, "M": 3, "N": 1, "O": 1, "P": 3, "Q": 10, "R": 1, "S": 1, "T": 1, "U": 1, "V": 4, "W": 4, "X": 8, "Y": 4, "Z": 10}

If you want to be useful to all players of the game, it would be worth loading the points values from a config file.

The current code is going to have problems in languages where not all tiles are single letters (e.g. DD₁ or LL₅ in a Welsh set).

It also doesn't handle wordsIf you ever try Super Scrabble, you'll find that span more than one doublethere are quad-word or tripleletter and quad-word squarespaces, or claiming the 50-point bonus for playing all tilestoo; it would be a nice enhancement to support those, and not too difficult to implement.

This line, as well as being unwieldy (use some line breaks!) restricts this program to English scrabble:

letter_val = {" ": 0, "A": 1, "B": 3, "C": 3, "D": 2, "E": 1, "F": 4, "G": 2, "H": 4, "I": 1, "J": 8, "K": 5, "L": 1, "M": 3, "N": 1, "O": 1, "P": 3, "Q": 10, "R": 1, "S": 1, "T": 1, "U": 1, "V": 4, "W": 4, "X": 8, "Y": 4, "Z": 10}

If you want to be useful to all players of the game, it would be worth loading the points values from a config file.

The current code is going to have problems in languages where not all tiles are single letters (e.g. DD₁ or LL₅ in a Welsh set).

It also doesn't handle words that span more than one double-word or triple-word square, or claiming the 50-point bonus for playing all tiles.

#Bugs I think the calculation is incorrect when there's both letter multipliers and word multipliers in play - the letter multipliers should be computed first, so that they get multiplied up by the word multiplier, too.

It also doesn't handle words that span more than one double-word or triple-word square, or claiming the 50-point bonus for playing all tiles.

#Improvements

This line, as well as being unwieldy (use some line breaks!) restricts this program to English scrabble:

letter_val = {" ": 0, "A": 1, "B": 3, "C": 3, "D": 2, "E": 1, "F": 4, "G": 2, "H": 4, "I": 1, "J": 8, "K": 5, "L": 1, "M": 3, "N": 1, "O": 1, "P": 3, "Q": 10, "R": 1, "S": 1, "T": 1, "U": 1, "V": 4, "W": 4, "X": 8, "Y": 4, "Z": 10}

If you want to be useful to all players of the game, it would be worth loading the points values from a config file.

The current code is going to have problems in languages where not all tiles are single letters (e.g. DD₁ or LL₅ in a Welsh set).

If you ever try Super Scrabble, you'll find that there are quad-letter and quad-word spaces, too; it would be a nice enhancement to support those, and not too difficult to implement.

Source Link
Toby Speight
  • 81.7k
  • 14
  • 101
  • 308

This line, as well as being unwieldy (use some line breaks!) restricts this program to English scrabble:

letter_val = {" ": 0, "A": 1, "B": 3, "C": 3, "D": 2, "E": 1, "F": 4, "G": 2, "H": 4, "I": 1, "J": 8, "K": 5, "L": 1, "M": 3, "N": 1, "O": 1, "P": 3, "Q": 10, "R": 1, "S": 1, "T": 1, "U": 1, "V": 4, "W": 4, "X": 8, "Y": 4, "Z": 10}

If you want to be useful to all players of the game, it would be worth loading the points values from a config file.

The current code is going to have problems in languages where not all tiles are single letters (e.g. DD₁ or LL₅ in a Welsh set).

It also doesn't handle words that span more than one double-word or triple-word square, or claiming the 50-point bonus for playing all tiles.