Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (16 sloc) 327 Bytes
#!/usr/bin/env perl
use strict;
use warnings;
my $answer = 10;
print ">>>";
chomp(my $input = <STDIN>);
my $diff = $answer - $input;
if ($answer == $input) {
print "OK\n";
} elsif ( -5 <= $diff && $diff <= 5 ) {
print "near\n";
} elsif ($answer > $input) {
print "too small\n";
} else {
print "too big\n";
}