Enos scrabble documentation addendum Notes on algorithms: HASHING ======= The fast hashing (HashOfWords.java) scheme finds words in essentially constant time: search for bucket is O(1) using bitmapped encoding of the word (26-bit bitmap converted to a decimal number ranging from 0..2^26-1); search for specific words matching letters in the combination being examined is linear in a small constant, specifically the number of words having the same letters as the combination checked, (irrespective of cardinality), and comparison is again made numerically, this time using an 8-bit per letter encoding of the cardinality of specific letters. In this way, we can achieve an average search time for the next move (in the fast, non-minmax version of the client) of an average of 150 millliseconds per move on the cs cluster. EVALUATING COMBINATIONS OF LETTERS ================================== combinations of letters from the hand are selected and order for search for words using the following heuristic: >sum is taken over the total possible bigram frequencies in the combination > combination is ranked according to the formula: exp(bigramSum)* totalLetterScore This heuristic produced the highest mean word score of heuristics tried. Running the test suite included will demonstrate thse results. CLASSES ======= >src: (root package - no package name enos EnosScrabbleClient.java Client class for scrabble server; contains a Game object representing game state. Communicates with Game by passing messages via a Move object. >src/enos/scrabble/datastruct: HashOfWords.java Data structure for dictionary src/enos/scrabble/domain: Anchor.java Enapsulates component of word using letters from the board. Board.java Validates moves, finds collateral words made by placing a word on the board. Dictionary.java Ecapsulates hash map, provides for search. Game.java Contains entire state of the game; is cloned for use at each node of MiniMax search. InvalidMoveException.java Used to signal invalid move. LetterBonusSquare.java Encasulates a bonus that multiplies entire Word. MoveGroup.java Encapsulates the Move played and any collateral scoring moves created on the board by the word played. Move.java Encapsulates the word played, its location and score. PlainSquare.java Sqaure with no bonus. Player.java Encapsulates the heuristics used in choosing potential moves. Rack.java Player's current hand. Provides permutations of letters in hand. Square.java Superclass for all squares. WordBonusSquare.java Bonus that multiplies only its letter. Word.java Encapulates the letters of a move, the anchor on the board, the letter score, and the bigram potentiality of the word. src/enos/scrabble/test: Classes that contain unit tests for various domain and datastructure classes BoardTest.java HashTest.java ScrabbleTest.java src/enos/scrabble/util: BigramEvaluator.java Orders words using bigram algorithm described above. MiniMaximizer.java MiniMax search.