#!/usr/bin/perl
-# use strict;
+use strict;
use Dart;
+our $sieb =1; # Spielmodus Zahlensieb
$|=1;
callbacks => {
shoot=>\&shoot,
next_player=>\&next_player,
+ before_shoot=>\&print_score,
}
);
-exit $dart->run(STDIN,STDOUT);
+exit $dart->run();
### ===============================
-my $sieb =1; # Spielmodus Zahlensieb
sub gueltig
{
my ($zahl,$mult) = @_;
{
$score->{$zahl}++;
$self_scored++;
- if ($sieb && ($score->{$zahl} == 3))
+ if ($main::sieb && ($score->{$zahl} == 3))
{
for my $count (2..21)
{
$self->shout_last_shoot() if ($scored || $self_scored);
$self->shout("scored") if $scored;
$self->shout("scho") if $scho && not $scored;
- &print_score($self);
}
sub next_player
{
my $self=shift;
- &print_score($self);
}
sub print_score