mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-17 05:50:56 +01:00
cjeopardy: If answer is integral, then respond "too big!" or "too small!" respectively
This commit is contained in:
parent
f31ce372cc
commit
c3dde27328
@ -114,6 +114,16 @@ foreach my $answer (@valid_answers) {
|
|||||||
$supplemental_text = $1;
|
$supplemental_text = $1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($answer =~ /^[0-9]+$/ and $lctext =~ /^[0-9]+$/) {
|
||||||
|
if ($lctext > $answer) {
|
||||||
|
print "$lctext is too big!\n";
|
||||||
|
exit;
|
||||||
|
} elsif ($lctext < $answer) {
|
||||||
|
print "$lctext is too small!\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
my $distance = fastdistance($lctext, lc $answer);
|
my $distance = fastdistance($lctext, lc $answer);
|
||||||
my $length = (length($lctext) > length($answer)) ? length $lctext : length $answer;
|
my $length = (length($lctext) > length($answer)) ? length $lctext : length $answer;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user