mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-23 11:12:42 +01: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:
parent
236b4c1d06
commit
9651847165
@ -13,7 +13,7 @@ use warnings;
|
||||
# These are set automatically by the build/commit script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 757,
|
||||
BUILD_REVISION => 758,
|
||||
BUILD_DATE => "2014-07-29",
|
||||
};
|
||||
|
||||
|
@ -47,14 +47,12 @@ foreach my $answer (@valid_answers) {
|
||||
my $length = (length($text) > length($answer)) ? length $text : length $answer;
|
||||
|
||||
if ($distance / $length < 0.15) {
|
||||
my $correctness;
|
||||
if ($distance == 0) {
|
||||
$correctness = "correct!";
|
||||
print "'$answer' is correct!\n";
|
||||
} 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_HINT-$channel";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user