diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-07-05 09:11:37 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-07-05 09:11:37 -0500 |
commit | a12e592c538f370277e787cd57d01d512e1ca835 (patch) | |
tree | 481618caafa245bf53c42ea3b4c0e3a9585ca15b | |
parent | 57acbbb1df995469780164a5b7a7148753d6c4d0 (diff) | |
download | games-word-a12e592c538f370277e787cd57d01d512e1ca835.tar.gz games-word-a12e592c538f370277e787cd57d01d512e1ca835.zip |
fix jotto when the wordlist has non-word characters
-rw-r--r-- | bin/jotto.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/jotto.pl b/bin/jotto.pl index 82406e6..4d9f509 100644 --- a/bin/jotto.pl +++ b/bin/jotto.pl @@ -5,8 +5,8 @@ use Games::Word qw/shared_letters/; use Games::Word::Wordlist; my $wl = Games::Word::Wordlist->new('/usr/share/dict/words'); -$wl->remove_words($wl->words_like(qr/^(\w{0,4}|\w{6,})$/)); -$wl->remove_words($wl->words_like(qr/^[A-Z]/)); +$wl->remove_words($wl->words_like(qr/^(.{0,4}|.{6,})$/)); +$wl->remove_words($wl->words_like(qr/[^a-z]/)); my $word = $wl->random_word; my $guesses = 0; while (1) { |