Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Code tuning (was Re: ASCII Battleship Program)

by roboticus (Chancellor)
on Feb 04, 2012 at 05:36 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://951764]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-20 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found