in reply to Fast wordlist lookup for game
Simply use a hash if memory is not an issue (you should test this.
my %dict; foreach my $word (@wordlist) { # or read from file ;-) $dict{$word} = 1; } if (exists $dict{'someWord'}) {...}
Feel free to use (or modify) this code
.Hope this helps, -gjb-
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Fast wordlist lookup for game
by jerrygarciuh (Curate) on Oct 29, 2002 at 22:52 UTC | |
by sauoq (Abbot) on Oct 29, 2002 at 23:56 UTC | |
by agentv (Friar) on Oct 29, 2002 at 23:02 UTC | |
by jerrygarciuh (Curate) on Oct 29, 2002 at 23:06 UTC |