Permalink
Browse files

Make number of exits and rows options

  • Loading branch information...
1 parent 85243a4 commit 2aeb0ac3a878cf997d142d40e994526d1477070b @jtpalmer committed Mar 29, 2011
Showing with 14 additions and 2 deletions.
  1. +14 −2 week4/electriclines.pm
View
@@ -1,8 +1,20 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use 5.010;
+use Getopt::Long;
use FindBin qw( $Bin );
use lib "$Bin/lib";
use Games::ElectricLines;
-Games::ElectricLines->new()->run();
+
+my $lines = 4;
+my $exits = 1;
+my $result = GetOptions(
+ 'lines=i' => \$lines,
+ 'exits=i' => \$exits,
+);
+die "See README for usage\n" unless $result;
+
+Games::ElectricLines->new(
+ _row_count => $lines,
+ _exit_count => $exits,
+)->run();

0 comments on commit 2aeb0ac

Please sign in to comment.