- or download this
given ($let) {
when (/A/i) {
...
$let = 9;
}
}
- or download this
sub letter_to_coord {
# Converts A .. J into 0 .. 9, assuming valid data entered.
...
return $num if $num < 10 and $num >= 0;
die "invalid input!";
}
- or download this
sub print_both_boards {
print "USER BOARD:";
...
print " @t\n";
}
}
- or download this
sub generate_ship_pos::any_ship {
my $size = shift;
...
}
#push @main::com_ships::com_all_ships, map { "$$_[0]$$_[1]" } @shi
+p;
}
- or download this
sub place_ship {
my ($x, $y, $size, $orient, $type) = @_;
...
print "You have entered invalid input. Please try again.\n\n";
}
}
- or download this
#!/usr/bin/perl
use v5.10.1;
...
);
return @t;
}