Skip to content
Browse files

Basic sanity checks

  • Loading branch information...
1 parent 73191bb commit 485d795d2b12c11cafb3b2ae77b5f0bc072e6d94 @jtpalmer committed Mar 28, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 week4/electriclines.pm
View
8 week4/electriclines.pm
@@ -6,14 +6,18 @@ use FindBin qw( $Bin );
use lib "$Bin/lib";
use Games::ElectricLines;
-my $lines = 4;
-my $exits = 1;
+my $lines = 4;
+my $exits = 1;
my $result = GetOptions(
'lines=i' => \$lines,
'exits=i' => \$exits,
);
die "See README for usage\n" unless $result;
+$lines = 2 if $lines < 2;
+$exits = $lines - 1 if $exits >= $lines;
+$exits = 1 if $exits < 1;
+
Games::ElectricLines->new(
_row_count => $lines,
_exit_count => $exits,

0 comments on commit 485d795

Please sign in to comment.
Something went wrong with that request. Please try again.