Subject: | bin/bingo.pl stops early |
Running bin/bingo.pl, the code ends after having drawn 89 numbers, not 90. The attached patch fixes the main loop for this.
Index: bin/bingo.pl
===================================================================
RCS file: /usr/data/cvs/modules/Games/Bingo/bin/bingo.pl,v
retrieving revision 1.6
diff -u -r1.6 bingo.pl
--- bin/bingo.pl 2003/07/30 17:53:11 1.6
+++ bin/bingo.pl 2003/08/17 20:47:45
@@ -3,10 +3,9 @@
# $Id: bingo.pl,v 1.6 2003/07/30 17:53:11 jonasbn Exp $
use strict;
-use lib qw(../lib/ lib);
use Games::Bingo;
-my $version = "0.01";
+my $version = "0.02";
my $bingo = Games::Bingo->new(90);
@@ -18,7 +17,7 @@
sub main {
my $number;
- while(scalar @{$bingo->{'_numbers'}}) {
+ while (1) {
system("clear");
print "########################################\n";
@@ -27,8 +26,11 @@
show_taken(\@taken);
- print "\nNumber = $number\n" if $number;
- print "\nHit <Return> for next number\n";
+ print "\nNumber = $number\n\n" if $number;
+
+ last unless scalar @{$bingo->{'_numbers'}};
+
+ print "Hit <Return> for next number\n";
my $v = <STDIN>;
$number = $bingo->play();
@@ -82,7 +84,7 @@
=head1 DESCRIPTION
This is a console bingo game application. With bingo_print.pl from
-Games::Bingo::Print you can generate cards and they you are actually
+Games::Bingo::Print you can generate cards and then you are actually
ready to play.
=cut
@@ -121,4 +123,4 @@
Games::Bingo is (C) 2003 Jonas B. Nielsen (jonasbn)
E<gt>jonasbn@cpan.orgE<lt>
-=cut
\ No newline at end of file
+=cut