Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Code tuning (was Re: ASCII Battleship Program)

by roboticus (Chancellor)
on Feb 04, 2012 at 05:36 UTC ( #951764=note: print w/replies, xml ) Need Help??

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;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://951764]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2021-02-25 03:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?