mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-22 20:09:43 +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;
|
||||
}
|
||||
|
||||
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 $length = (length($lctext) > length($answer)) ? length $lctext : length $answer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user