.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Games::Bingo 3" .TH Games::Bingo 3 "2008-01-05" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Games::Bingo \- a bingo game Perl implementation .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Games::Bingo; \& my $bingo = Games::Bingo-Enew(90); .Ve .PP .Vb 1 \& my $bingo = Games::Bingo-Enew(); .Ve .PP 90 is actually the default .PP .Vb 1 \& my $number = $bingo-Eplay(); >> .Ve .PP .Vb 1 \& my @taken; .Ve .PP .Vb 1 \& $bingo-Epull(\e@pulled, $number); .Ve .PP or .PP .Vb 2 \& use Games::Bingo; \& my $bingo = Games::Bingo-Enew(); .Ve .PP .Vb 2 \& my @numbers; \& $bingo-Einit(\e@numbers, 90); .Ve .PP .Vb 2 \& my $number = $bingo-Eplay(\e@numbers); \& my @taken; .Ve .PP .Vb 1 \& $bingo-Etake(\e@taken, $number); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" 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 \fB\s-1TODO\s0\fR section (below). .SH "METHODS" .IX Header "METHODS" This are the central methods of Games::Bingo .Sh "new" .IX Subsection "new" The constructor is quite simple. It can either be called without any paramters and then followed by a call to \fBinit\fR see below or the ceiling for the numbers (stored internally) can be given as a parameter, the latter is the recommeded use. .PP 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 \&\s-1API\s0, please refer to the \fB\s-1SYNOPSIS\s0\fR. .PP The attributes of the class are the following: .IP "_numbers" 4 .IX Item "_numbers" The list holding all the numbers in the pull pool. .IP "_numbers_pulled" 4 .IX Item "_numbers_pulled" A list holding the numbers which have been pulled. .IP "game" 4 .IX Item "game" A flag indicating where the game currently are and how it should be run. .Sp These are the different values: .RS 4 .IP "* 0" 4 Game is over .IP "* 1" 4 .IX Item "1" full card (the default) .IP "* 2" 4 .IX Item "2" 2 rows .IP "* 3" 4 .IX Item "3" 1 row .RE .RS 4 .RE .Sh "init" .IX Subsection "init" This method takes two parameters. An array reference and a ceiling, the method will push numbers onto the array reference from 1 to ceiling (including the ceiling). Initializing the numbers for the game. .PP The use of init is not recommended, use the constructor in the recommended way instead. .PP Returns 1 upon success. .Sh "play" .IX Subsection "play" The \fBplay\fR is one of the essential methods in the game, it takes an array reference and returns a random number from the array referenced to. The reference shrinks with one with each call. .PP The recommended way is though to use the internally stored array, where play then takes no arguments, please refer to \fBnew\fR and \fBinit\fR and the \fB\s-1SYNOPSIS\s0\fR. .Sh "take" .IX Subsection "take" The \fBtake\fR method is the memory of the game. It takes to parameters, a reference to an array of arrays (the memory), and additionaly the number picked by e.g. the \fBplay\fR method. .PP Since the first program to use the class/module was a console based the take method organizes the numbers in an array of array for a nicer presentation. This will probably be changed later (if necessary). .Sh "random" .IX Subsection "random" The encapsulation of the rand function. Takes a number as a paramtere and returns a number between 0 and the number given as a parameter just as rand (% perldoc \-f rand). .PP The result is rounded down using POSIX::floor .Sh "pulled" .IX Subsection "pulled" A method which return 1 or 0 indicating true or false, whether the number given as a parameter has been pulled. .Sh "_all_pulled" .IX Subsection "_all_pulled" A method which returns all pulled numbers as an array. .Sh "pull" .IX Subsection "pull" A clumsy alias/\*(L"overload\*(R" implementation of the take method. .Sh "splitnumber" .IX Subsection "splitnumber" Takes a number (prepends 0 its a single digit number) and returns it split in two (We use this for identifying the column it belongs to). .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "Games::Bingo::Column" 4 .IX Item "Games::Bingo::Column" .PD 0 .IP "Games::Bingo::ColumnCollection" 4 .IX Item "Games::Bingo::ColumnCollection" .IP "Games::Bingo::Print" 4 .IX Item "Games::Bingo::Print" .IP "Games::Bingo::Card" 4 .IX Item "Games::Bingo::Card" .IP "Games::Bingo::Bot" 4 .IX Item "Games::Bingo::Bot" .IP "\fIbin/bingo.pl\fR" 4 .IX Item "bin/bingo.pl" .PD .SH "TODO" .IX Header "TODO" The \s-1TODO\s0 file contains a complete list for the whole Games::Bingo project. .SH "BUGS" .IX Header "BUGS" Please report issues via \s-1CPAN\s0 \s-1RT:\s0 .PP .Vb 1 \& http://rt.cpan.org/NoAuth/Bugs.html?Dist=Games-Bingo .Ve .PP or by sending mail to .PP .Vb 1 \& bug-Games-Bingo@rt.cpan.org .Ve .SH "TEST COVERAGE" .IX Header "TEST COVERAGE" .Vb 10 \& ---------------------------- ------ ------ ------ ------ ------ ------ ------ \& File stmt bran cond sub pod time total \& ---------------------------- ------ ------ ------ ------ ------ ------ ------ \& blib/lib/Games/Bingo.pm 100.0 100.0 100.0 100.0 100.0 22.3 100.0 \& blib/lib/Games/Bingo/Card.pm 100.0 100.0 66.7 100.0 100.0 21.5 99.4 \& ...lib/Games/Bingo/Column.pm 100.0 100.0 n/a 100.0 100.0 24.3 100.0 \& ...Bingo/ColumnCollection.pm 92.5 84.6 33.3 100.0 100.0 31.4 90.6 \& .../Games/Bingo/Constants.pm 100.0 n/a n/a 100.0 n/a 0.4 100.0 \& Total 98.2 94.1 62.5 100.0 100.0 100.0 97.4 \& ---------------------------- ------ ------ ------ ------ ------ ------ ------ .Ve .SH "AUTHOR" .IX Header "AUTHOR" jonasbn .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" This is a compilation of all the people have helped me, their names are also scattered all over the modules where appropriate. .IP "* Rikke Gornitzka for inviting me to the real bingo game, which started all this" 4 .IX Item "Rikke Gornitzka for inviting me to the real bingo game, which started all this" .PD 0 .IP "* Matt Sergeant (\s-1MSERGEANT\s0) for suggesting using PDFLib" 4 .IX Item "Matt Sergeant (MSERGEANT) for suggesting using PDFLib" .IP "* Allan Juul algoritms and code help" 4 .IX Item "Allan Juul algoritms and code help" .IP "* Michael Legart (\s-1LEGART\s0) trying to understand my problems" 4 .IX Item "Michael Legart (LEGART) trying to understand my problems" .IP "* Lars Thegler (\s-1THEGLER\s0) for several bug reports" 4 .IX Item "Lars Thegler (THEGLER) for several bug reports" .IP "* Casper Warming (\s-1WARMING\s0), for helping with the \s-1OSX\s0 client" 4 .IX Item "Casper Warming (WARMING), for helping with the OSX client" .IP "* The remaining Copenhagen Perl Mongers for testing the \s-1IRC\s0 game" 4 .IX Item "The remaining Copenhagen Perl Mongers for testing the IRC game" .IP "* Mike Castle for his \s-1POD\s0 patch" 4 .IX Item "Mike Castle for his POD patch" .IP "* All the ppl who have commented on my journal coming with suggestions etc." 4 .IX Item "All the ppl who have commented on my journal coming with suggestions etc." .PD .SH "COPYRIGHT" .IX Header "COPYRIGHT" Games::Bingo and related modules are free software and is released under the Artistic License. See for details. .PP Games::Bingo is (C) 2003\-2007 Jonas B. Nielsen (jonasbn)