Games::Bingo - a bingo game Perl implementation
use Games::Bingo;
my $bingo = Games::Bingo-E<gt>new(90);
my $bingo = Games::Bingo-E<gt>new();
90 is actually the default
my $number = $bingo-E<gt>play(); >>
my @taken;
$bingo-E<gt>pull(\@pulled, $number);
or
use Games::Bingo;
my $bingo = Games::Bingo-E<gt>new();
my @numbers;
$bingo-E<gt>init(\@numbers, 90);
my $number = $bingo-E<gt>play(\@numbers);
my @taken;
$bingo-E<gt>take(\@taken, $number);
This is a simple game of bingo. The program can randomly call out the numbers. The game will be get more features in the future, please refer to the TODO section (below).
This are the central methods of Games::Bingo
The constructor is quite simple. It can either be called without any paramters and then followed by a call to init see below or the ceiling for the numbers (stored internally) can be given as a parameter, the latter is the recommeded use.
If no indicator of the number of numbers you want in your bingo game is given the game defaults to 90. This can be overwritten if using the old API, please refer to the SYNOPSIS.
The attributes of the class are the following:
The list holding all the numbers in the pull pool.
=item _numbers_pulled
A list holding the numbers which have been pulled.
=item game
A flag indicating where the game currently are and how it should be run.
These are the different values: