Goo-Canvas
view release on metacpan or search on metacpan
bin/perlmine.pl view on Meta::CPAN
sub win {
if ( $DEBUG ) {
print "You win!\n";
}
$game_status = STOP;
Glib::Source->remove($timer);
$image_but->set_image(Gtk2::Image->new_from_file($image{'win'}));
return;
my $new_entry = [$Config{name} || getlogin || getpwuid($<) || 'Nobody', $elapse_time];
my ($idx, $new_iter);
if ( $#$history > 8 ) {
$#$history = 8;
}
push @$history, $new_entry;
$idx = $#$history;
my $dia = Gtk2::Dialog->new(
'Rank', undef, # $window,
['modal', 'destroy-with-parent'],
'gtk-ok' => 'ok',
bin/perltetris.pl view on Meta::CPAN
sub rank_dia {
my $score = shift;
my ($idx, $new_iter, $new_entry);
my $max = $Config{max_rank_list}-1;
if ( defined $score ) {
if ( !defined $history ) {
$history = [ $new_entry ];
$idx = 0;
} else {
$new_entry = [$Config{name} || getlogin || getpwuid($<) || 'Nobody', $score];
$history = [ sort {$b->[1] <=> $a->[1]} @$history ];
$idx = 0;
while ( $idx <= $#$history ) {
last if $score >= $history->[$idx][1];
$idx++;
}
if ( $idx > $max && $idx > $#$history ) {
return;
} else {
splice(@$history, $idx, 0, $new_entry);
( run in 0.368 second using v1.01-cache-2.11-cpan-8d75d55dd25 )