Games::Battleship::Craft

Software Screenshot:
Games::Battleship::Craft
Software Details:
Version: 0.05
Upload Date: 3 Jun 15
Developer: Gene Boggs
Distribution Type: Freeware
Downloads: 18

Rating: nan/5 (Total Votes: 0)

Games::Battleship::Craft is a Battleship craft class.

SYNOPSIS

use Games::Battleship::Craft;

my $craft = Games::Battleship::Craft->new(
id => 'T',
name => 'tug boat',
points => 1,
)

$points_remaining = $craft->hit;

A Games::Battleship::Craft object represents the profile of a Battleship

PUBLIC METHODS

new %ARGUMENTS

id => $STRING

A scalar identifier to use to indicate position on the grid. If one is not provided, the uppercased first name character will be used by default.

Currently, it is required that this be a single uppercase letter (the first letter of the craft name, probably), since a hit will be indicated by "lowercasing" this mark on a player grid.

name => $STRING

A required attribute provided to give the craft a name.

points => $NUMBER

An attribute used to define the line segment span on the playing grid.

position => [$X, $Y]

The position of the craft bow ("nose") on the grid.

Currently, the craft is assumed to have a horizontal or vertical alignment. Soon there will be diagonal positioning...

hit

$points_remaining = $craft->hit;

Increment the craft's hit attribute value and return what's left of the craft (total point value minus the number of hits).

Requirements:

  • Perl

Similar Software

OpenSSL
OpenSSL

5 Sep 16

TCPDF
TCPDF

17 Jul 15

tcpdump
tcpdump

22 Jun 18

Libnet
Libnet

20 Feb 15

Comments to Games::Battleship::Craft

Comments not found
Add Comment
Turn on images!