The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Games::Domino::Tile - Represents the tile of the Domino game.

VERSION

Version 0.01

DESCRIPTION

The Games::Domino::Tile class is used by Games::Domino class internally. It shouldn't be used directly.

METHODS

value()

Returns the value of the tile i.e. sum of left and right bips.

    use strict; use warnings;
    use Games::Domino::Tile;

    my $tile = Games::Domino::Tile->new({ left => 1, right => 4 });
    print "Value of the tile is [" . $tile->value . "].\n";

as_string()

Returns the tile object as string. This method is overloaded as string context. So if we print the object then this method gets called. You can explictly call this method as well. Suppose the tile has 3 left bips and 6 right bips then this would return it as [3 | 6].

    use strict; use warnings;
    use Games::Domino::Tile;

    my $tile = Games::Domino::Tile->new({ left => 1, right => 4 });
    print "The tile is $tile\n";
    # same as above
    print "The tile is " . $tile->as_string() . "\n";

AUTHOR

Mohammad S Anwar, <mohammad.anwar at yahoo.com>

BUGS

Please report any bugs or feature requests to bug-games-domino at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Games-Domino. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Games::Domino::Tile

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright 2012 Mohammad S Anwar.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

DISCLAIMER

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.