next up previous contents index
Next: Initialize Global Variables Up: Hangman Previous: Putting the pieces together   Contents   Index


Pick a word

    $wordlist = '/usr/share/dict/words';
    open DICTIONARY, $wordlist;
    @words = <DICTIONARY>;
    chomp(@words);
    $number = scalar(@words);
    $random = rand;
    $choice = lc($words[$number * $random]);



Tom Hunt 2002-06-09