aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-194/james-smith/perl/ch-1.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/challenge-194/james-smith/perl/ch-1.pl b/challenge-194/james-smith/perl/ch-1.pl
index c0583712de..35d08c6689 100644
--- a/challenge-194/james-smith/perl/ch-1.pl
+++ b/challenge-194/james-smith/perl/ch-1.pl
@@ -23,14 +23,16 @@ sub digit_2359 {
sub {
$_[0] eq '?' ? ( $_[1]<4 ? 2 : 1 )
: $_[1] eq '?' ? ( $_[0]<2 ? 9 : 3 )
- : $_[3] eq '?' ? 5 : 9
+ : $_[3] eq '?' ? 5
+ : 9
}->( split //, $_[0] );
}
sub digit_2400 {
sub {
- $_[0] eq '?' ? ( $_[1]==4 && $_[3]==0 && $_[4]==0 || $_[1]<4 ? 2 : 1 )
- : $_[1] eq '?' ? ( $_[0]<2 ? 9 : $_[3]==0 && $_[4]==0 ? 4 : 3 )
- : $_[3] eq '?' ? 5 : 9
+ $_[0] eq '?' ? ( $_[1]<4 ? 2 : $_[1]==4 && $_[3]==0 && $_[4]==0 ? 2 : 1 )
+ : $_[1] eq '?' ? ( $_[0]<2 ? 9 : $_[3]==0 && $_[4]==0 ? 4 : 3 )
+ : $_[3] eq '?' ? 5
+ : 9
}->( split //, $_[0] );
}