Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.

X Report information
Id: 3271
Status: resolved
Left: 0 min
Priority: 0/0
Queue: Games-Bingo

Owner: JONASBN <jonasbn [...] cpan.org>
Requestors: lars [...] thegler.dk
Cc:
AdminCc:

Severity: Important
Broken in: 0.07
Fixed in: 0.08

X Attachments



X History Display mode: Brief headersFull headers
#   Sun Aug 17 16:54:02 2003 guest - Ticket created  
Subject: bin/bingo.pl stops early
[text/plain 123b]
Running bin/bingo.pl, the code ends after having drawn 89 numbers, not 90. The attached patch fixes the main loop for this.
[text/plain 1.3k]
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

#   Mon Aug 18 01:51:17 2003 JONASBN - Taken  
#   Thu Aug 21 17:25:11 2003 JONASBN - Fixed in 0.08 added  
#   Thu Aug 21 17:25:47 2003 JONASBN - Status changed from 'new' to 'resolved'  
#   Thu Aug 21 17:25:47 2003 JONASBN - Correspondence added  
[text/plain 47b]
Patch included in G::B 0.08, thanks :)

jonasbn