SQUABBLE is a version of the game Scrabble in which players compete against the computer to make words on a board using randomly allotted letters.
- Simple user interface
- Dictionary of 270,163 words
- Games can be saved and reloaded
- Two stage hint option
- Choice of difficulty rating
- Choice of game times
- Source code included (Python)
The program uses a built-in dictionary representing the Collins Scrabble Word List 2012, which contains 270,163 words. It was downloaded from the zyzzyva site. Within the program the dictionary is represented as Directed Acyclic Word Graph. In converting the dictionary into a DAWG I was greatly helped by Steve Hanov's elegant method. The word fitting code is based on Appel, Andrew; Jacobsen, Guy (1988), "The World's Fastest Scrabble Program" (PDF), Communications of the ACM.
When SCRABBLE is played with a board and tiles there can be doubts about the acceptability of the words made by players and they can be challenged by their opponents, after which the words are checked in a dictionary. If the words are found to be incorrect they are removed from the board and the player forfeits that turn. In SQUABBLE there are no challenges: the game contains the dictionary and always knows all the possible words and where they can fit on the board. So, the program will only accept words from its dictionary that will fit on the current board. But, it will allow the player to keep trying words until one is acceptable. Hence the player does not forfeit the turn. However, if the player wishes to observe the standard rules she can simply punch the clock immediately after attempting to place a word that the program rejects.
The Toolbar icons were obtained from the Softicons site and were designed by Turbomilk and released under the Creative Commons licence. The dictionary source and programming help is mentioned above. Thanks.
You play against the computer, each taking turns to make words on the board using randomly allotted letters. The first word placed on the board must cross the central square and all subsequent words must cross or touch at least one previously laid word.
As marked on the tiles, each letter has a score. The score for a turn is the sum of the scores for all new words created by the placed tiles, and is increased by double and triple letter squares (dark and light blue, respectively) and double and triple word scores (red and pink respectively). You also get a bonus of 50 if you manage to use all your tiles in a single turn. The sack contains two blank tiles which are wild cards that can take any letter value when played and retain that letter throughout the game. They score 0.
Please refer to Figure 1. The player has a clock which counts down from a maximum value (by default 25 minutes). The program also has a clock but its time is always blank because it is quick (on my machine, if the computer plays against itself, it can play a complete game every 1.6 seconds). The player's clock and tiles are at the bottom of the display, those of the computer at the top. If your clock is running it is your turn. Remember to stop the clock when you have had your turn.
The File menu at the top of the window allows games to be saved and loaded, for the maximum time to be changed and for the difficulty level to be set. The difficulty level is termed the program's IQ, and ranges from 10 to 100. Winning against IQ 100 is very hard. The five buttons next to the file menu start a new game (star), request tile swapping (curved arrow), request a hint (wand), place the hint word on the board (cross of arrows) and allow the user to punch the program's clock (clockface).
Start a new game by clicking on the blue star. The program randomly decides who gets first turn. If your clock (bottom of window) is ticking, it is you. Type your word into the Entrybox to the right of your clock. When you type "Enter" the program will check the word. If the Entrybox turns double word score pink the word is unacceptable. You can edit it or enter another. If the Entrybox has a white background the word is accepted. Note that even if you are only adding a single letter to an existing word you must enter the complete word.
Now you have to to tell the program where to put the word. To place a word you click on the square or tile at the position of the beginning of the word. A left-click means the word should be placed across the board, a right-click means it should go down the board. If the position and direction are accepted the tiles will be drawn on the board. If the Entrybox goes double letter blue you've made a mistake: either the wrong square or the wrong direction. Note, you must enter the word before defining its position on the board and once a word is accepted it cannot be changed. Once the word has appeared on the board punch the program's clock by clicking on the clockface in the Toolbar. This will also stop your clock and update your score. The program will then take its turn and then restart your clock.
Blank tiles, once added to the board are given the letter they represent, but written in lowercase.
If you are unable to go or are unhappy with your current tiles you can replace any number of them (while there are still at least 7 in the notional sack) by clicking on the curved arrow and then typing the letters of the tiles you want to discard into the Entrybox. Again finish with "Enter". If the Entrybox turns triple word score red the letters contain an error and should be edited. Otherwise the tiles will be replaced. Punch the program's clock.
You can also ask for a hint by clicking on the wand in the Toolbar. If it is possible for you to go the program will type the highest scoring word in the Entrybox. You can then click on the appropriate position on the board, or if you cannot work out where the word goes, a click on the cross of arrows will cause the program to place the word for you. Punch the program's clock.
The game ends when the tiles run out or you and the computer have been unable to place a tile for 6 consecutive turns. If one of you finishes all their tiles the game ends and the program will finalise the scores.
To save a game select "Save Game" in the File menu and supply a file name. By default the program will store saved games in its own SAVES directory. To load a saved game select "Load Game" from the file menu and choose the required game file.