From a12e592c538f370277e787cd57d01d512e1ca835 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 5 Jul 2012 09:11:37 -0500 Subject: fix jotto when the wordlist has non-word characters --- bin/jotto.pl | 4 ++-- 1 file 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) { -- cgit v1.2.3-54-g00ecf