From c3dde27328e76445323fe6cb931ccaeb6af3b5cb Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 24 Jan 2015 08:05:47 -0800 Subject: [PATCH] cjeopardy: If answer is integral, then respond "too big!" or "too small!" respectively --- modules/cjeopardy_answer.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/cjeopardy_answer.pl b/modules/cjeopardy_answer.pl index 0764230a..4653f4df 100755 --- a/modules/cjeopardy_answer.pl +++ b/modules/cjeopardy_answer.pl @@ -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;