Help for this page

Select Code to Download


  1. or download this
    given ($let) {
      when (/A/i) {
    ...
         $let = 9;
      }
    }
    
  2. 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!";
    }
    
  3. or download this
    sub print_both_boards {
       print "USER BOARD:";
    ...
            print " @t\n";
       }
    }
    
  4. or download this
    sub generate_ship_pos::any_ship {
        my $size = shift;
    ...
        }
        #push @main::com_ships::com_all_ships, map { "$$_[0]$$_[1]" } @shi
    +p;
    }
    
  5. or download this
    sub place_ship {
        my ($x, $y, $size, $orient, $type) = @_;
    ...
            print "You have entered invalid input. Please try again.\n\n";
        }
    }
    
  6. or download this
    #!/usr/bin/perl
    use v5.10.1;
    ...
        );
        return @t;
    }