CITS2002 Systems Programming  
prev
next CITS2002 CITS2002 schedule  

More text file reading - the game of Scrabble

Let's quickly consider another example employing reading a text file.

scrabble In the game of Scrabble, each letter tile has a certain value - the rarer a letter is in the English language, the higher the value of that letter ('E' is common and has the value 1, 'Q' is rare and has the value 10).

Can we write C functions to determine:

  • the value of a word in Scrabble?
  • the word in a dictionary with the highest value?
  • the best word to choose from a set of tiles?
In writing these functions we won't consider all of the rules of Scrabble.

Another consideration (which we'll ignore) is that there are fixed tile frequencies - for example, there are 12 'E's but only 1 'Q'.

Refer to Wikipedia for the actual distributions.
scrabble

 


CITS2002 Systems Programming, Lecture 8, p9, 15th August 2023.