Author of:
and maintainer of:
Well my girlfriend invited me to a bingo friday night.
No I am not the bingo playing age, but it was fun and it was for a good cause (funding a schooltrip to Iceland).
Well the whole bingo thing was run on a large screen, actually due to the face that the organisers were def.
Looking the computer program I came to think I actually never made a bingo game for my computer, so here goes first draft for bingo.pl
#!/usr/bin/perl -w
use strict;
use POSIX;
my @numbers;
my @taken;
init(\@numbers, \@taken);
while(scalar @numbers) {
my $pos = POSIX::floor(rand(scalar @numbers));
my $number = $numbers[$pos];
#print "number = $number\n";
splice(@numbers, $pos, 1);
take(\@taken, $number);
system("clear");
show_taken(\@taken);
}
sub init {
my $numbers = shift;
my $taken = shift;
for(my $i = 1; $i 0)) {
@$taken->[$j][$k] = " ";
} else {
@$taken->[$j][$k] = "[ ]";
}
}
}
}
sub show_taken {
my $taken = shift;
for (my $m = 0; $m [$m][$n];
}
print "\n";
}
}
sub take {
my $taken = shift;
my $take = shift;
my $take2 = sprintf("%02d", $take);
my ($x, $y) = $take2 =~ m/^(\d{1})(\d{1})$/;
@$taken->[$x][$y] = '['.$take2.']';
}
with the following benchmark:
0.850u 1.340s 0:05.01 43.7% 0+0k 0+7io 0pf+0w
I DO NOT recommend this game to old people it could prove hazardous.
I have committed bingo.pl to the Copenhagen.pm CVS server snippes section, check there for updates...
Dictionary Bingo (Score:2)
I've put the code here [axkit.org] in case anyone is bored and wants to play bingo
Bingo - there it is! (Score:1)
I expect also to make some control mechanisms so that the program can see when a plate has bingo.
This could also form the base for the actual game.
PDFLib on OS X (Score:1)
You wouldn't happen to know how to get PDFLib running under OS X?
- I downloaded the tarball from www.pdflib.com, but there is no installation quite, and I do not quite understand the structure of the pm file (the package name is not PDFLib).
I will probably ask this question at the Perl OS X mailing list when I get the time.
SUCCESS (was: Re:PDFLib on OS X) (Score:1)
This link [yahoo.com] holds the solution.
Which actually just is a simple:
bash-2.05$ CFLAGS=-I/Developer/Headers/FlatCarbon LDFLAGS="-framework CoreServices -framework ApplicationServices"