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 < 91; $i++) { push @$numbers, $i; }
for (my $j = 0; $j < 10; $j++) {
for (my $k = 0; $k < 10; $k++) {
if (($j == 0 and $k == 0) or ($j == 9 and $k > 0)) {
@$taken->[$j][$k] = " ";
} else {
@$taken->[$j][$k] = "[ ]";
}
}
}
}
sub show_taken {
my $taken = shift;
for (my $m = 0; $m < 10; $m++) {
for (my $n = 0; $n < 10; $n++) {
print @$taken->[$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...
SUCCESS (was: Re:PDFLib on OS X)
jonasbn on 2002-12-19T21:50:25
I have finally gotten PDFLib to compile on my machine.
This link holds the solution.
Which actually just is a simple:
bash-2.05$ CFLAGS=-I/Developer/Headers/FlatCarbon LDFLAGS="-framework CoreServices -framework ApplicationServices"./configure