3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

C Jeopardy: Correct showing of text/answer in "close enough" output due to recent change in handling of typographical case

This commit is contained in:
Pragmatic Software 2014-07-29 20:21:06 +00:00
parent 236b4c1d06
commit 9651847165
2 changed files with 3 additions and 5 deletions

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script # These are set automatically by the build/commit script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 757, BUILD_REVISION => 758,
BUILD_DATE => "2014-07-29", BUILD_DATE => "2014-07-29",
}; };

View File

@ -47,14 +47,12 @@ foreach my $answer (@valid_answers) {
my $length = (length($text) > length($answer)) ? length $text : length $answer; my $length = (length($text) > length($answer)) ? length $text : length $answer;
if ($distance / $length < 0.15) { if ($distance / $length < 0.15) {
my $correctness;
if ($distance == 0) { if ($distance == 0) {
$correctness = "correct!"; print "'$answer' is correct!\n";
} else { } else {
$correctness = "close enough to '$answer'. You are correct!" print "'$text' is close enough to '$answer'. You are correct!\n"
} }
print "'$answer' is $correctness\n";
unlink "$CJEOPARDY_DATA-$channel"; unlink "$CJEOPARDY_DATA-$channel";
unlink "$CJEOPARDY_HINT-$channel"; unlink "$CJEOPARDY_HINT-$channel";