GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GAMES::BINGO::CARD (3)

.ds Aq ’

NAME

Games::Bingo::Card - a helper class for Games::Bingo

CONTENTS

SYNOPSIS



        use Games::Bingo::Card;

        my $b = Games::Bingo-E<gt>new(90);
        my $card = Games::Bingo::Card-E<gt>new($b);

        my $bingo = Games::Bingo-E<gt>new(90);
        $card-E<gt>validate($bingo);

        use Games::Bingo::Card;

        my $p = Games::Bingo::Card-E<gt>new();
        $p-E<gt>populate();



DESCRIPTION

The Games::Bingo::Card class suits the simple purpose of being able to generate bingo cards and validating whether they are valid in during a game where a player indicate victory.

It is also used by Games::Bingo::Print to hold the generated bingo cards before they are printed.

METHODS

    new

This method generates an object representing a bingo card.

The constructor, takes no arguments.

    populate

This method is the main method of the class. It populates the card objects with a predefined number of randomly picked numbers which can be printed using the Games::Bingo::Print class.

    _init

Init uses the function in Games::Bingo::Column and Games::Bingo::ColumnCollection, which are use to generate the necessary random numbers to generate the card and set the them in the necessary columns.

    _insert

This is the private method which is used to insert numbers onto the card in the Bingo::Games::Card class.

Populate takes to arguments, the row and the number, it resolves the column using <B>_resolve_columnB>.

    _resolve_column

Resolve column is method used to resolve where on the card a specified number should go. It takes a number and returns an integer indicating a column.

    _integrity_check

This method is a part of the work-around, which was made in the <B>populateB> method, it checks whether the populated card holds 12 numbers return a boolean value indicating succes or failure.

    validate

This method can validate a bingo card against a game. So it easily can be examined whether a player/card has bingo.

The method takes one argument, the Games::Bingo object of the current game.

This method does not hold the same flaw as the method above though.

    _print_card

This is the console version of the <B>_print_cardB> version, which is implemented in <B>Games::Bingo::PrintB>.

It prints the generated card with numbers.

    _flush

This method can be used to flush the contents of the <B>CardB> object.

    get_all_numbers

Returns all the numbers contained in the <B>_arrayB> attribute as an array.

BUGS

This class contains a bug in <B>populateB>, which is regarded a design flaw. A work-around have implemented. See the BUGS file.

No other bugs are known at the time of writing.

SEE ALSO

Games::Bingo
Games::Bingo::Bot
Games::Bingo::Column
Games::Bingo::Column::Collection
Games::Bingo::Constants
Games::Bingo::Print

TODO

The TODO file contains a complete list for the whole Games::Bingo project.

AUTHOR

Jonas B. Nielsen, (jonasbn) - <jonasbn@cpan.org>

COPYRIGHT

Games-Bingo is (C) by Jonas B. Nielsen, (jonasbn) 2003-2015

Games-Bingo is released under the artistic license 2.0

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 GAMES::BINGO::CARD (3) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.