This is a scrabble AI (Artificial Intelligence) I decided to write as a quick 1 day project (though I went back later and reoptimized a bit more) in C that takes any board configuration and tile set and finds the best possible word worth the most points during that turn.
It utilizes a brute force AI, and a Digital Search Tree for the Dictionary. The dictionary can be any plain text file with words separated by spaces named dict.txt. Press F2 for my example board.
Controls:
At any time
Arrow keys: Move around the board, the tile rack can be reached by moving past the bottom row.
Enter: Run the AI to find the best word
F1: Saves the current board and rack to ScrabbleBoard.sve
F2: Loads the current board and rack from ScrabbleBoard.sve
Space: Add a blank tile to the rack. Using a blank makes the AI take exponentially longer. 2 spaces can take up to around 30 seconds (on my current computer) as there are an exponential number of more possibilities to search through.
When on the board
A-Z: Place a lettered tile
Delete or BackSpace: Remove a tile
When on tile rack
A-Z: Add a tile to the rack. A maximum of 7 tiles are allowed.
Delete or BackSpace: Remove the last tile
2 versions are available:
Scrabble.exe: Loads the normal dict.txt plain text dictionary
ScrabbleDBT.exe: Loads the dict.dbt dictionary file, which is in a custom digital binary tree format. This has a smaller dictionary file and is much quicker to load.