From 88dc009ae7325edf9449b893099da2cb9c09399c Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Tue, 29 Jul 2014 19:00:06 +0000 Subject: [PATCH] C Jeopardy: Show correct typographical case for answers --- PBot/VERSION.pm | 2 +- modules/cjeopardy_answer.pl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index cd1979a0..48caf16f 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 755, + BUILD_REVISION => 756, BUILD_DATE => "2014-07-29", }; diff --git a/modules/cjeopardy_answer.pl b/modules/cjeopardy_answer.pl index c7fc3553..a5ae5d04 100755 --- a/modules/cjeopardy_answer.pl +++ b/modules/cjeopardy_answer.pl @@ -37,13 +37,13 @@ open my $fh, "<", "$CJEOPARDY_DATA-$channel" or print "There is no open C Jeopar @data = <$fh>; close $fh; -my @valid_answers = map { lc decode $_ } split /\|/, encode $data[1]; +my @valid_answers = map { decode $_ } split /\|/, encode $data[1]; foreach my $answer (@valid_answers) { chomp $answer; $answer =~ s/\\\|/|/g; - my $distance = fastdistance($text, $answer); + my $distance = fastdistance($text, lc $answer); my $length = (length($text) > length($answer)) ? length $text : length $answer; if ($distance / $length < 0.15) { @@ -54,7 +54,7 @@ foreach my $answer (@valid_answers) { $correctness = "close enough to '$answer'. You are correct!" } - print "'$text' is $correctness\n"; + print "'$answer' is $correctness\n"; unlink "$CJEOPARDY_DATA-$channel"; unlink "$CJEOPARDY_HINT-$channel";