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-
In reply to Re: Fast wordlist lookup for game
by gjb
in thread Fast wordlist lookup for game
by jerrygarciuh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |