// this class provides a dictionary for Hangman games // These approximately 400 words were drawn from a dictionary // extracted from /usr/dict/words by PLN import java.lang.reflect.Array; public class Dictionary { private final static String dictionary[] = { "aback","abrade","accelerate","acetylene","acumen", "admiralty","advise","afraid","ahem","alcohol", "allemand","also","amble","amplifier","andesine", "annular","antipathy","apology","apprehensive","arching", "armload","artistry","assailant","astronomer","attic", "autistic","avow","backfill","baleen","banshee", "barricade","batik","beaux","beforehand","bellyfull", "beside","bib","bimodal","birth","blanch", "bloodbath","boar","bombastic","booze","bout", "bratwurst","bribery","brokerage","buckaroo","bullseye", "burnt","buzz","cahoot","camber","cannon", "captor","carney","casteth","cauliflower","centenary", "chairwomen","chargeable","chef","chimney","chordate", "churn","citizen","claustrophobia","clockwise","coagulable", "codfish","coleus","coltsfoot","committal","competent", "compulsive","condemnatory","confluent","connotative","constitute", "continue","convect","copperhead","corpse","cotillion", "county","cowpony","craw","crib","crotchety", "cubbyhole","curium","cycle","dang","deal", "decertify","dedicate","degeneracy","deluge","denote", "depressor","desperado","deuterate","diamagnetism","differentiate", "dine","discretion","dissipate","divorce","dolomitic", "douce","drainage","drool","duffel","dynamic", "ebb","effeminate","elastic","ellipsoid","embroider", "enact","enforce","enthrall","ephemerides","equipotent", "escrow","eulogy","evzone","excruciate","exorcist", "explore","extractor","facial","famish","fatuous", "feminism","fiasco","filigree","fireplace","flamingo", "flier","flowery","foil","forbid","forte", "fracture","frenetic","froth","furious","gagwriter", "gantry","gavotte","geochemistry","gibby","gladiolus", "glottis","goes","grab","grapheme","greyhound", "grout","gulf","gyrate","hallucinate","handymen", "hash","headset","hegemony","heptane","heterostructure", "hill","hoarse","homeward","hopping","hot", "hum","hydra","hypocritic","idle","imitable", "impend","impoverish","inapplicable","inclusive","inculpable", "indiscriminate","inertance","infighting","inglorious","innate", "insoluble","integrable","interrogatory","introvert","involution", "irresolute","jack","jest","journeymen","jurisprudential", "ketch","kinetic","know","ladle","lapelled", "launch","leaky","legislate","levy","ligament", "linkage","livre","loggerhead","lot","lumen", "lyricism","magnetite","malfunction","manikin","marinade", "masquerade","maverick","medicinal","menagerie","message", "miasmal","mile","mineral","misshapen","modulus", "monkeyflower","morn","mourn","multiplicand","mustang", "naive","neater","nereid","newsstand","nirvana", "norm","noxious","nylon","obsessive","octoroon", "oily","onward","opus","ornery","outermost", "paddle","panda","paradise","park","passer", "patrol","peccary","pendant","perchance","permutation", "pessimal","phenomenon","phyla","pigeonberry","pinwheel", "placental","platting","plucky","polar","polyphony", "porous","postman","practical","predominate","prescriptive", "primary","proctor","prolong","proprietary","prototype", "psychoacoustic","pulmonary","purpose","quadrennial","quay", "quota","raffish","ransack","reach","reck", "redtop","regimentation","remainder","repent","reside", "restroom","rever","rhodonite","rimy","robotics", "rot","ruddy","ruthenium","saint","sanction", "satan","scale","schlieren","scram","sculptor", "secretary","selectman","sept","set","shaken", "shelve","shoji","shrike","sidelight","silken", "sinister","skidding","slant","slivery","smith", "sniffly","societal","solstice","sopping","soya", "speck","spidery","spoilage","spruce","squirt", "stannic","stayed","stethoscope","stoichiometric","straightforward", "stripping","stunning","subtly","sulfurous","superannuate", "surmount","swapping","swizzle","synergy","tad", "tanh","tatty","tedium","template","termite", "thank","thermodynamic","thither","thrumming","tigress", "title","tonk","tortoiseshell","traffic","transfix", "trapezoidal","triable","tripartite","trout","tun", "tweak","tyrannicide","uniform","uprise","usurer", "valve","vend","version","victorious","visa", "volatile","wage","ware","waterfall","webbing", "whee","whirring","wiggle","winter","wold", "workpiece","write","yen","zig"}; public static String getRandomWord(){ // returns a random word from the dictionary // Math.random() returns a number in the iterval [0.0,1) // int index; index = (int)Math.floor(Math.random() * Array.getLength(dictionary)); return dictionary[index]; } }