bill.apps.wordutil
Class WordUtil

java.lang.Object
  |
  +--bill.apps.wordutil.WordUtil

public class WordUtil
extends Object

Static methods that are used across the various word games.


Constructor Summary
WordUtil()
           
 
Method Summary
static String createNewLetter(short[] rankings)
          Determine a new letter to add to a puzzle.
static Random getRandom()
          Get the "random" number generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordUtil

public WordUtil()
Method Detail

getRandom

public static Random getRandom()
Get the "random" number generator. If the randomizer had not yet been created, do so, seeding it with the current time.
Returns:
The randomizer.

createNewLetter

public static String createNewLetter(short[] rankings)
Determine a new letter to add to a puzzle. Each letter is given a rank/weight. A letter with a rank of 2 is twice as likely to be included in a puzzle as a letter with a rank of 1. A letter with a rank of 4 is twice as likely to be included as a 2, and four times as likely as a 1, etc.
Returns:
The new letter.