Result:
found more than 856 distributions - search limited to the first 2001 files matching your query ( run in 2.595 )


Game-EnergyLoop

 view release on metacpan or  search on metacpan

eg/rhythm.pl  view on Meta::CPAN

my @events;
my $out_file = shift // 'out.midi';

class Timer {
    field $name :param :reader = "none";
    field $alive :reader = 1;
    field $callback :param :writer;
    field $energy :param            = 96;
    field $cur_energy               = 0;
    field $start :param             = 0;
    field $priority :param :reader  = 0;

eg/rhythm.pl  view on Meta::CPAN

        unless ( $stash->{advanced} ) {
            $dtime = $value;
            $stash->{advanced} = 1;
        }
        my $spawn = $callback->( $dtime, $channel, $pitch, $velocity );
        $alive = 0 if --$ttl <= 0;
        $start = 0;
        # when we're next scheduled to run (if still alive)
        return defined $spawn ? ( $energy, $spawn ) : $energy;
    }
}

# Create a note_on event, and schedule a note_off for later.

eg/rhythm.pl  view on Meta::CPAN

}

my $cost;
do {
    $cost    = Game::EnergyLoop::update( \@objects, \&reorder, $stash );
    @objects = grep { $_->alive } @objects;
    $stash->{advanced} = 0;
} while ( $cost < ~0 );

sub make_tracks () { [ MIDI::Track->new( { events => \@events } ) ] }

 view all matches for this distribution


Game-Entities

 view release on metacpan or  search on metacpan

lib/Game/Entities.pm  view on Meta::CPAN


sub created ($self) { scalar @{ $self->{entities} } - 1 }

# Get the number of created entities that are still valid; that is, that have
# not been deleted.
sub alive ($self) {
    my $size = @{ $self->{entities} } - 1;
    my $current = $self->{available};

    until ( $current->$is_null ) {
        $size--;

 view all matches for this distribution


Game-HexDescribe

 view release on metacpan or  search on metacpan

share/hex-describe-johnston-table.txt  view on Meta::CPAN

1,The extreme humidity of the *[name for jungle]* makes breathing difficult, but has the added benefit of disabling most robots.
1,The *[name for jungle]* seems to be extra hostile today. Swaying [colour] vines grab at your arms and legs.
1,The *[name for jungle]* is thick with [colour] vegetation and surprisingly unyielding.
1,The rain is unceasing as you stumble your way through the *[name for jungle]*. The trail is slowly being eroded away.
1,The [colour] under and overgrowth are heavy tangled in the *[name for jungle]*.
1,The *[name for jungle]* is alive with animal grunts and growls which are nearly deafening and definitely terrifying.
1,There are sudden cliffs and precarious paths hiddden by choking, thorny vines in the *[name for jungle]*.
1,The triple canopies in the *[name for jungle]* have trapped almost all of the heat and humidity close to the ground making it feel like a madman's greenhouse. 
1,The *[name for jungle]* seems to be alive and waiting for you to let down your guard.
1,[capitalize colour] dew drips unceasingly from all species of foliage in the *[name for jungle]*.

;swamp
1,The foul smelling quicksand of the *[name for swamp]* pulls at your feet as you trudge along.
1,The tidal quicksand of the *[name for swamp]* ebbs and flows, and you feel yourself sinking in deeper and deeper.

share/hex-describe-johnston-table.txt  view on Meta::CPAN

1,The Necromagisters

;settlement mission
1,All is quiet here.
1,The people really don’t like outsiders disturbing the delicate power balance.
1,Currently, [marshal|sheriff|boss] *[here human fancy name as sheriff]* is in the area, looking for a fugitive. “I’m looking for *[nearby wanted criminal]*. [Do me a favour and let me know if you find them|I’ll reward you if you lead me to the...

# Caves

;cave people
1,The [1d6x10] **morlocks** ([morlock stats]) living in these caves have no access to the deeper levels. All they seek is shelter from the elements and a defensible home. At night, they emerge from the underground to do their hunting and gathering. [...

share/hex-describe-johnston-table.txt  view on Meta::CPAN


;physical mutations explained
1,<h2>Physical Mutations</h2><dl><dt>Acid Touch<dd>The mutant can convey a strong acid by touch. The acid will do 1d10 damage for 3 rounds.<dt>Cat Eyes<dd>The mutant is able to see in complete darkness as if it were daylight.<dt>Chameleon<dd>The muta...

;mental mutations explained
1,<h2>Mental Mutations</h2><dl><dt>Animal Friendship<dd>The mutant is friendly to all animals and animaloids.<dt>Animal Telepathy<dd>The mutant can communicate with all animals and animaloids up to 25 meters.<dt>Blur<dd>The mutant is just a blur for ...

;plant mutations explained
1,<h2>Plant Mutations</h2><dl><dt>Accumulated Resistance<dd>The plant gains immunity to cold, electric, energy, heat, or radiation attacks after 1 round.<dt>Acid Sap<dd>The plant conveys an acidic sap on contact which does 3d6 damage.<dt>Animal Telep...

 view all matches for this distribution


Game-Life-Faster

 view release on metacpan or  search on metacpan

lib/Game/Life/Faster.pm  view on Meta::CPAN

initial population, and then the rules are iterated. In each iteration
cells change state based on their current state and how many of the 8
adjacent cells (orthogonally or diagonally) are "living".

In Conway's original formulation, the rules were that a "dead" cell
becomes alive if it has exactly two living neighbors, and a "living"
cell becomes "dead" unless it has two or three living neighbors.

This implementation was inspired by L<Game::Life|Game::Life>, and is
intended to be reasonably compatible with its API. But the internals
have been tweaked in a number of ways in order to get better

 view all matches for this distribution


Game-Life-Infinite-Board

 view release on metacpan or  search on metacpan

lib/Game/Life/Infinite/Board.pm  view on Meta::CPAN


=head2 C<updateCell>

C<< $board->updateCell($x,$y,$state); >>

Set the state of the cell with coordinates $x,$y to $state, where $state can be 0 (dead) or 1..4 (alive). Standard rules board (not colored) can only use 1 for alive cell. Immigration board can only use 1 or 2. 

=head2 C<loadInit>

C<< $board->loadInit($filename) >>

 view all matches for this distribution


Game-Life

 view release on metacpan or  search on metacpan

Life.pm  view on Meta::CPAN

=head1 DESCRIPTION

Conway's Game of Life is a basic example of finding 'living' patterns
in rather basic rulesets (see B<NOTES>).  The Game of Life takes
place on a 2-D rectangular grid, with each grid point being either
alive or dead.  If a living grid point has 2 or 3 neighbors within the
surrounding 8 points, the point will remain alive in the next
generation; any fewer or more will kill it.  A dead grid point will
become alive if there are exactly 3 living neighbors to it.  With
these simple rules, fascinating structures such as gliders that move
across the grid, glider guns that generate these gliders, XOR gates,
and others have been found.

This module simply provides a way to simulate the Game of Life in Perl.

Life.pm  view on Meta::CPAN

=item C<place_text_points>

Takes two scalars (indicated the position on the grid), a character,
and an array of strings; as with C<place_points>, this array will
be placed into the grid at the specified position.  The character indicates
what cells are to be considered as alive; any other character in the 
string will be considered dead.  Thus, the example given in the B<SYNOPSIS>
can be writen optionally as

	my @starting = qw( XXX
                           X..

 view all matches for this distribution


Game-WordBrain

 view release on metacpan or  search on metacpan

lib/Game/WordBrain/WordList.pm  view on Meta::CPAN

alitrunk
aliturgic
aliturgical
ality
aliunde
alive
aliveness
alives
alivincular
aliya
aliyah
aliyahaliyahs
aliyas

lib/Game/WordBrain/WordList.pm  view on Meta::CPAN

calisayas
calistheneum
calisthenic
calisthenical
calisthenics
caliver
calix
calixtin
calk
calkage
calked

lib/Game/WordBrain/WordList.pm  view on Meta::CPAN

cantador
cantala
cantalas
cantalever
cantalite
cantaliver
cantaloup
cantaloupe
cantaloupes
cantando
cantankerous

lib/Game/WordBrain/WordList.pm  view on Meta::CPAN

realisticize
realisticness
realists
realities
reality
realive
realizability
realizable
realizableness
realizably
realization

lib/Game/WordBrain/WordList.pm  view on Meta::CPAN

unaligned
unalike
unalimentary
unalimentative
unalist
unalive
unallayable
unallayably
unallayed
unalleged
unallegedly

 view all matches for this distribution


Games-AIBots

 view release on metacpan or  search on metacpan

lib/Games/AIBots.pm  view on Meta::CPAN

        $bot->{'cloak'} = 0;
    }
}

sub tick_check {
    my (%alive, $hasfuel, $missiles);
    return if !$Running;

    foreach my $bot (@Bots) {
        $alive{$bot->{'team'} || bot_id($bot)}++ unless $bot->{'dead'};
        $hasfuel++ unless $bot->{'dead'} or $bot->{'fuel'} <= 0;
        foreach my $missile (@{$bot->{'missiles'}}) {
            $missiles++ unless $missile->{'dead'};
        }
    }

    if (!$missiles and (scalar keys(%alive) <= 1) or !$hasfuel) {
        # Game Over
        display('end');

        my %TScore;
        foreach my $bot (@Bots) {
            $bot->{'score'}  += 50 * $bot->{'life'};
            $bot->{'score'}  -= $bot->{'burn'};
            $bot->{'score'}  += 500 / $alive{$bot->{'team'} || bot_id($bot)}
                unless $bot->{'dead'} or (scalar keys(%alive) > 1);
            $TScore{$bot->{'team'} || bot_id($bot)} += $bot->{'score'} || 0;
            $bot->{'lastcmd'} = '**End**';
        }

        my @BScore = sort {$b->{'score'} <=> $a->{'score'}} @Bots;

 view all matches for this distribution


Games-Axmud

 view release on metacpan or  search on metacpan

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

                'This command can only be used when the Status task is running and when there\'s'
                . ' a current character profile',
            );
        }

        if ($status eq '-a' || $status eq 'alive') {
            $session->currentChar->ivPoke('lifeStatus', 'alive');
        } elsif ($status eq '-s' || $status eq 'sleep') {
            $session->currentChar->ivPoke('lifeStatus', 'sleep');
        } elsif ($status eq '-p' || $status eq 'passout') {
            $session->currentChar->ivPoke('lifeStatus', 'passout');
        } elsif ($status eq '-d' || $status eq 'dead') {
            $session->currentChar->ivPoke('lifeStatus', 'dead');
        } else {

            return $self->error(
                $session, $inputString,
                'Invalid life status (try -a -s -p -d / alive sleep passout dead)',
            );
        }

        # Tell the Status task that its task window must be updated with a new background colour
        $session->statusTask->set_lifeStatusChangeFlag();

 view all matches for this distribution


Games-BubbleBreaker

 view release on metacpan or  search on metacpan

t/00-run.t  view on Meta::CPAN

if($stderr) {
    diag( "\$^X   = $^X");
    diag( "STDERR = $stderr");
}

pass 'Are we still alive? Checking for segfaults';

done_testing();

 view all matches for this distribution


Games-Cryptoquote

 view release on metacpan or  search on metacpan

t/patterns.txt  view on Meta::CPAN

1|2|3|4|4|6|7|8|9|6|5|12:Stubblefield|
1|2|3|4|4|6|7|8|9|6|5|12|13:Stubblefields|
1|2|3|4|4|6|7|8|9|6|7:challenging|
1|2|3|4|4|6|7|8|9|7|11:shuttlecock|
1|2|3|4|4|6|7|8|9|8:chubbiness|
1|2|3|4|5:Aaron|Abner|Abram|Acton|Adair|Adams|Adler|Aesop|Agnes|Agnew|Agway|Aides|Aiken|Ainus|Aires|Akers|Akron|Alamo|Alcoa|Alden|Aleck|Aleut|Alger|Alice|Alsop|Alton|Altos|Alvin|Amiga|Ampex|Andes|Andre|Angie|Anglo|Angus|Anita|April|Arabs|Araby|Arden|...
1|2|3|4|5|1:agenda|alumna|amoeba|anemia|asthma|cognac|cosmic|damned|danced|darned|darted|dashed|dawned|demand|devoid|dialed|dished|docked|downed|draped|ducked|dumped|dusted|edible|elapse|empire|enable|encode|encore|endure|enrage|ensure|entice|entire|...
1|2|3|4|5|1|1:escapee|sadness|shyness|surpass|
1|2|3|4|5|1|1|2:escapees|
1|2|3|4|5|1|1|5|9|10:submission|submissive|
1|2|3|4|5|1|1|5|9|10|1:submissions|

 view all matches for this distribution


Games-Euchre

 view release on metacpan or  search on metacpan

lib/Games/Euchre/Trick.pm  view on Meta::CPAN


Games::Euchre::Trick - Trick class for Euchre card game

=head1 DESCRIPTION

Only one Trick instance is alive at one time per Euchre game.  The
Trick keeps track of which cards have been played, and provides useful
functions to determine which cards are legal plays, as well as who
is the winner of the trick.  The trick class makes the determination
of which card beats which card, given the current trump and lead.  The
trick class knows how to handle an alone hand and it calls the

 view all matches for this distribution


Games-EveOnline-API

 view release on metacpan or  search on metacpan

lib/Games/EveOnline/API.pm  view on Meta::CPAN


=head2 ua

The underlying L<LWP::UserAgent> object.  Default to a new one
with no special arguments.  Override this if you want to, for
example, enable keepalive or an HTTP proxy.

=cut

has user_id      => (is=>'ro',   isa=>Int );
has api_key      => (is=>'ro',   isa=>Str );

 view all matches for this distribution


Games-EveOnline-EveCentral

 view release on metacpan or  search on metacpan

t/res/quicklook.xml  view on Meta::CPAN

            <expires>2014-03-21</expires>
            <reported_time>12-20 23:42:29</reported_time>
          </order><order id="3311654591">
            <region>10000013</region>
            <station>61000089</station>
            <station_name>YM-SRU VIII - Jigsaw is alive</station_name>
            <security>-0.8</security>
            <range>32767</range>
            <price>5.25</price>
            <vol_remain>2611203</vol_remain>
            <min_volume>1</min_volume>

 view all matches for this distribution


Games-Go-Cinderblock

 view release on metacpan or  search on metacpan

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN

   isa => 'Games::Go::Cinderblock::State',
   is => 'ro', #shouldn't change.
   required => 1,
);

has _alive => (
   isa => 'HashRef[Games::Go::Cinderblock::NodeSet]',
   is => 'ro',
   lazy => 1,
   builder => '_initially_generous_with_life',
);

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN

   builder => '_initial_dame',
);

#has _seki => (); #

#based on state, has dame, derived, & alive. that is everything initially.
#this is an attribute so we can initialize these 3 categories at the same time, if needed.
has _initial_cats => (
   is => 'ro',
   isa => 'HashRef', #dame isn't color-separated; the others are.
   lazy => 1,

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN

   my $self = shift;

   my $remaining_nodes = $self->rulemap->all_nodes_nodeset;
   my %initial_cats = (
      dame => $self->rulemap->nodeset,
      alive => {
         w => $self->rulemap->nodeset,
         b => $self->rulemap->nodeset,
      },
      derived_terr => {
         w => $self->rulemap->nodeset,

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN

      my $stone = $self->state->at_node($node);
      if($stone){
         my $cond = sub{ $_ eq $stone};
         my $contiguous = $self->state->floodfill ($cond, $node);
         $remaining_nodes->remove($contiguous);
         $initial_cats{alive}{$stone}->add($contiguous);
      }
      else { #space.
         my $cond = sub{ ! $_ };
         my $contiguous = $self->state->floodfill ($cond, $node);
         my $adjacent = $contiguous->adjacent;

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN

   my $self = shift;
   return $self->_initial_cats->{derived_terr}
}
sub _initially_generous_with_life{
   my $self = shift;
   return $self->_initial_cats->{alive}
}
sub _empty_nodesets{
   my $self = shift;
   return {
      b => $self->rulemap->nodeset,
      w => $self->rulemap->nodeset,
   };
}
  
# return undef if unoccupied 
# return 0 if dead, 1 if alive
sub node_animated{
   my ($self,$node) = @_;
   my $stone = $self->state->at_node($node);
   return undef unless $stone;
   return 0 if $self->_dead->{$stone} -> has_node($node);
   return 1 if $self->_alive->{$stone} -> has_node($node);
   Carp::confess;
}

#transanimation -- to toggle the status of life/death, reanimate^deanimate
#nop if not occupied.

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN

   }
   else{
      return $self->reanimate($node);
   }
};
sub reanimate{ #dead -> alive
   my ($self,$node) = @_;
   my $stone = $self->state->at_node($node);
   die "no stone at @$node..." unless $stone;
   
   return 0 if $self->node_animated($node);

   my $bounded_color = ($stone eq 'w') ? 'b' : 'w';
   my $new_ambiguous_space = $self->state->floodfill(sub{$_ ne $bounded_color}, $node);
   my $new_alives = $self->state->grep_nodeset(sub{$_ eq $stone}, $new_ambiguous_space);
   $new_ambiguous_space->remove($new_alives);

   #first, put stones from dead category into alive 
   $self->_dead->{$stone} -> remove ($new_alives);
   $self->_alive->{$stone} -> add ($new_alives);

   #put each seperate contiguous region of empty space in either 'dame' or 'derived_terr'
   my @amb_spaces = $new_ambiguous_space->disjoint_split;
   for my $space(@amb_spaces){
      $self->_known_terr->{$bounded_color}->remove($space);

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN

      }
   }
   
   return 1;
}
sub deanimate{ #alive -> dead
   my ($self,$node) = @_;
   my $stone = $self->state->at_node($node);
   die "no stone at @$node..." unless $stone;

   return 0 unless $self->node_animated($node);

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN

   $self->_derived_terr->{w}->remove($new_known_terr);
   $self->_derived_terr->{b}->remove($new_known_terr);
   $self->_dame->remove($new_known_terr);
   $self->_known_terr->{$bounded_color}->add($new_known_terr);

   #same for stones: alive -> dead category
   $self->_alive->{$stone}->remove($new_deads);
   $self->_dead->{$stone}->add($new_deads);

   return 1
}

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN


=head2 Stone-occupied node categories:

=over 4

=item alive

The initial state.

=item dead

A scorable must be told what stones are dead.

=item seki? 

not implemented. Maybe the stones are alive in seki? dunno how to mark seki.

=back

=head2 stoneless node categories:

=over 4

=item   known_territory 

considering stones that are known to be dead, this area is known to be alive.

=item   derived_territory

Surrounded by stones that may be deanimated.

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN

I think that this covers all categories related to score negotiation
for different scoring regimes.

=over 4

=item chinese rules -- alive stones are a point each.

=item japanese rules -- no territory in seki.

=back

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN


=over 4

=item deanimate -- To set as dead, to kill

=item reanimate -- To set as alive, to revive

=item animation -- the life/death state of a stone, chain, group, or any (in)?animate object

=item transanimate -- to animate xor deanimate something, to to toggle the life/death state

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN


=head2 dead ($color)

Returns a nodeset of stone of $color, which have been deanimated

=head2 alive ($color)

Returns a nodeset of nodes with stones of $color, which have not been deanimated.
Alive is the default state.

=head2 deanimate($node)

lib/Games/Go/Cinderblock/Scorable.pm  view on Meta::CPAN


Empty regions are initially either dame or derived territory.
marking a stone as dead has the effect of converting dame/derived to known
for the region bounded by stones of the opposite color.
reanimating dead stones returns its adjacent empty nodes to dame.
alive stones adjacent to known territory can not be deanimated.

=head1 REPRESENTATION

Each category has a hash attribute in the scorable object.
they are divided into colors, where each color of that cat has a B::NodeSet.
the cats are named _alive, _dead, _known_terr, _derived_terr, _dame, maybe _seki later.
each transanimation initiates a floodfill to discover the boundry of its the region
bordered by the opposite color.

The dame category is an exception. there is no color specified.

 view all matches for this distribution


Games-Go-GTP

 view release on metacpan or  search on metacpan

lib/Games/Go/GTP.pm  view on Meta::CPAN


sub final_status_list {
  my ($statustype, $referee, $player) = @_;
  my $pref;
  for ($statustype) {
    if (lc $_ eq 'alive') {
      $pref = $referee->listallalive;
      last
    }
    if (lc $_ eq 'dead') {
      $pref = $referee->listalldead;
      last

 view all matches for this distribution


Games-Go-Referee

 view release on metacpan or  search on metacpan

lib/Games/Go/Referee.pm  view on Meta::CPAN

}

# list all the live stones of a particular colour
# (as the set of all blocks adjacent to their opponent's illegal moves)

sub listalive {
  my ($self, $colour) = @_;

  # turn off alternation and passcount errors temporarily
  $self->{_const}{passcount} = 0;
  $self->{_const}{alternation} = 0;

lib/Games/Go/Referee.pm  view on Meta::CPAN

  $self->{_const}{alternation} = 1;
  return $points
}

# list the dead stones of a particular colour
# (as the difference between their alive list
# and their total list)

sub listdead {
  my ($self, $colour) = @_;
  my $allref = liststones($self, $colour);
  my $aliveref = listalive($self, $colour);
  my @dead = ();
  for (keys %$allref) {
    push @dead, $_ unless exists $aliveref->{$_};
  }
  @dead = map {
    /(.*),(.*)/;
    insertpoints($self, $1, $2) 
  } @dead;

 view all matches for this distribution


Games-Go-SGF2misc

 view release on metacpan or  search on metacpan

sgf/redrose-tartrate.sgf  view on Meta::CPAN

summer [2d\]: b is being nice
flop [6k?\]: not at all
Tictactoe [-\]: yes black holds hanami
Jigosaku [2k\]: seems b can hjust close up here
Rakshasa [3k\]: artemis: n18-o17-p16-n19-m19-o19-m18-n16-m16-o16
flop [6k?\]: flowery, b is not alive yet
transcend [9k\]: Why didnt black just play 01 instead of P3?
sita [2d\]: not really flower viewing, the ko
danoontje [6d\]: not quite, b is almost dead too
comboy [11k\]: wow, who is tartrate ?? I just looked at his stats
Dicey [13k\]: yeh

 view all matches for this distribution


Games-Go-Sgf2Dg

 view release on metacpan or  search on metacpan

lib/Games/Go/Sgf2Dg.pm  view on Meta::CPAN

    $depth++;
    if (HasLibs($x + 1, $y, $color, $been_here, $depth) or
        HasLibs($x - 1, $y, $color, $been_here, $depth) or
        HasLibs($x, $y + 1, $color, $been_here, $depth) or
        HasLibs($x, $y - 1, $color, $been_here, $depth)) {
        return(1);              # yes! we're alive!
    }
    return(0);                  # uh-oh! no liberties yet...
}

sub RemoveGroup {

 view all matches for this distribution


Games-GuessWord

 view release on metacpan or  search on metacpan

t/simple.t  view on Meta::CPAN

$g = Games::GuessWord->new(file => "t/words");
ok($g, "should create object ok");
foreach (1..21) {
#  print $g->secret . "\n";
  $g->new_word;
  ok($g->secret =~ /^(awake|asleep|alive)$/, "should read word in ok");
}




 view all matches for this distribution


Games-Lacuna-Client

 view release on metacpan or  search on metacpan

lib/Games/Lacuna/Client/Governor.pm  view on Meta::CPAN

    $self->{status} = $data->{status};
    my $planets        = $self->{status}->{empire}->{planets};
    my $home_planet_id = $self->{status}->{empire}->{home_planet_id};
    $self->{planet_names} = { map { $_ => $planets->{$_} } keys %$planets };

    my $do_keepalive = 1;
    my $start_time = time();

    $self->load_cache();

    do {
        my @priorities;
        if ( $self->{config}->{dry_run} ) {
            message("Starting dry run, actions are not actually taking place...");
        }
        $do_keepalive = 0;
        for my $pid ( keys %$planets ) {
            next if ( time() < $self->{next_action}->{$pid} );
            trace( "Examining " . $planets->{$pid} ) if ( $self->{config}->{verbosity}->{trace} );
            my $colony_config = merge( $config->{colony}->{ $planets->{$pid} } || {}, $config->{colony}->{_default_} );

lib/Games/Lacuna/Client/Governor.pm  view on Meta::CPAN

        if ( $self->{config}->{dry_run} ) {
            message("Dry run complete.");
            return;
        }
        my $next_action_in = min( grep { $_ > time } values %{ $self->{next_action} } ) - time;
        if ( defined $next_action_in && ( $next_action_in + time ) < ( $config->{keepalive} + $start_time ) ) {
            if ( $next_action_in <= 0 ) {
                $do_keepalive = 0;
            }
            else {
                my $nat_time = ptime($next_action_in);
                trace("Expecting to govern again in $nat_time or so, sleeping...") if ($self->{config}->{verbosity}->{trace});
                sleep( $next_action_in + 5 );
                $do_keepalive = 1;
            }
        }
    } while ($do_keepalive);

    $self->write_cache();
}

sub govern {

lib/Games/Lacuna/Client/Governor.pm  view on Meta::CPAN

=head2 dry_run

If this is true, Governor goes through the motions but does not actually
trigger any actions (such as upgrades, recycling jobs, or pushes).  The
output shows the actions as they would have taken place.  Enabling dry_run
disables keepalive behavior.

=head2 keepalive

This is the window of time, in seconds, to try to keep the governor alive
if more actions are possible.  Basically, if any governed colony's build
queue will be empty before the keepalive window expires, the script will
not terminate, but will instead sleep and wait for that build queue to empty
before once again governing that colony.  Setting this to 0 will
effectively disable this behavior.

=head2 push_max_travel_time

 view all matches for this distribution


Games-PangZero

 view release on metacpan or  search on metacpan

lib/Games/PangZero/PlayableGameBase.pm  view on Meta::CPAN


sub new {
  my ($class) = @_;
  my $self    = Games::PangZero::GameBase->new();
  %{$self}    = (%{$self},
    'playersalive'   => 0,
    'level'          => 0,
    'backgrounds'    => [ qw( desert2.png l1.jpg  l2.jpg  l3.jpg  l4.jpg  l5.jpg  l6.jpg  l7.jpg  l8.jpg  l9.jpg )],
  );
  bless $self, $class;
}

sub ResetGame {
  my $self              = shift;
  $self->SUPER::ResetGame();
  $self->{playersalive} = 0;
  $Games::PangZero::GamePause  = 0;

  foreach my $player (@Games::PangZero::Players) {
    last if $player->{number} >= $Games::PangZero::NumGuys;
    $self->SpawnPlayer($player);

lib/Games/PangZero/PlayableGameBase.pm  view on Meta::CPAN

  $player->{lives}             = 2;
  $player->{startX}            = ($Games::PangZero::ScreenWidth - $Games::PangZero::NumGuys * 60) / 2 + 60 * ($player->{number}+0.5) - 32;
  $player->{respawn}           = -1;
  my $guy                      = Games::PangZero::Guy->new($player);
  push @Games::PangZero::GameObjects, ($guy);
  ++$self->{playersalive};
  return $guy;
}

sub AdvanceGameObjects {
  my ($self) = @_;

lib/Games/PangZero/PlayableGameBase.pm  view on Meta::CPAN


  foreach my $player (@Games::PangZero::Players) {
    last if $player->{number} >= $Games::PangZero::NumGuys;
    if ($player->{respawn} > 0) {
      --$player->{respawn};
      $player->{score} = int($player->{respawn} / 100) if $self->{playersalive};
      if ($player->{respawn} <= 0) {
        my $guy            = $self->SpawnPlayer($player);
        $guy->{invincible} = 500;
      }
    }

lib/Games/PangZero/PlayableGameBase.pm  view on Meta::CPAN

    $self->{playerspawned} = 1;
  } else {
    # One player less
    Games::PangZero::Highscore::AddHighScore($guy->{player}, $guy->{player}->{score}, $self->{level} + 1);
    $guy->Delete();
    --$self->{playersalive};
    $guy->{player}->{respawn} = 6000; # 60s
  }
}

sub PlayerDeathSequence {

lib/Games/PangZero/PlayableGameBase.pm  view on Meta::CPAN


  if ($Games::PangZero::GameEvents{meltdown} and $Games::PangZero::DifficultyLevel->{name} ne 'Miki') {
    $self->DeathballMeltdown();
  } elsif ($Games::PangZero::GameEvents{kill} ) {
    $self->PlayerDeathSequence();
    return if $self->{playersalive} <= 0;
    $Games::PangZero::GamePause = 200 if $Games::PangZero::GamePause < 200;
    Games::PangZero::GamePause::Show();
  } elsif ($Games::PangZero::GameEvents{magic}) {
    if ($Games::PangZero::GamePause < 200) {
      $Games::PangZero::GamePause = 200;

lib/Games/PangZero/PlayableGameBase.pm  view on Meta::CPAN

    while ($advance--) {
      return if $self->{abortgame};
      $self->AdvanceGame();
    }

    if ($self->{playersalive} <= 0) {
      my $gameoverSurface = SDL::Image::load("$Games::PangZero::DataDir/gameover.png");
      my @gameObjects     = @Games::PangZero::GameObjects;
      foreach (@gameObjects) { $_->Delete() if ('Games::PangZero::DeadGuy' eq ref $_); }
      $self->DrawGame();
      SDL::Video::blit_surface($gameoverSurface, SDL::Rect->new(0, 0, $gameoverSurface->w, $gameoverSurface->h),

 view all matches for this distribution


Games-Perlwar

 view release on metacpan or  search on metacpan

lib/Games/Perlwar.pm  view on Meta::CPAN

                    { owner => '1337 h4ck3r', name => 'crash me', code => 'exit' },
                    { owner => '1337 h4ck3r', name => 'readdir me', code => 'opendir DIR, "."; return readdir DIR;' },
                    { owner => '1337 h4ck3r', name => 'infinite loop', code => '1 while 1' },
                    { owner => '1337 h4ck3r', name => 'backticks', code => '`ls`' },
                    { owner => '1337 h4ck3r', name => 'kill next', code => '"!1"' },
                    { owner => '1337 h4ck3r', name => 'must die', code => '"I am still alive?"' },
                    { owner => 'Yanick', name => 'good boy', code => '1' },
                    { owner => 'Yanick', name => 'owner', code => '"~-1"' },
                    { owner => 'Yanick', name => 'too big', code => 'a' x 200 },
                    ];
$pw->{config}{arraySize} = @{ $pw->{theArray} };

 view all matches for this distribution


Games-Snake

 view release on metacpan or  search on metacpan

lib/Games/Snake.pm  view on Meta::CPAN

        $player->direction( [ 1,  0 ] )  if $event->key_sym == SDLK_RIGHT;
        $player->direction( [ 0,  -1 ] ) if $event->key_sym == SDLK_UP;
        $player->direction( [ 0,  1 ] )  if $event->key_sym == SDLK_DOWN;

        my $key = SDL::Events::get_key_name( $event->key_sym );
        if ( !$player->alive && $key eq 'r' ) {
            $self->player( $self->_build_player );
        }
    }
}

lib/Games/Snake.pm  view on Meta::CPAN

    my $player = $self->player;

    $player->move($t);

    if ( $player->hit_self() || $level->is_wall( $player->head ) ) {
        $player->alive(0);
    }
    elsif ($player->head->[0] == $self->apple->[0]
        && $player->head->[1] == $self->apple->[1] )
    {
        $player->speed( $player->speed * 0.9 );

lib/Games/Snake.pm  view on Meta::CPAN

        0xC20006FF );

    $self->player->draw($app);
    $self->level->draw($app);

    if ( !$self->player->alive ) {
        $app->draw_gfx_text( [ 12, 12 ],
            0xFFFFFFFF,
            'Snake length: ' . scalar @{ $self->player->segments } );
        $app->draw_gfx_text( [ 12, 22 ], 0xFFFFFFFF, 'Press R to restart' );
    }

 view all matches for this distribution


Games-Word-Wordlist-Enable

 view release on metacpan or  search on metacpan

lib/Games/Word/Wordlist/Enable.pm  view on Meta::CPAN

alighting alightment alightments alights align aligned aligner aligners
aligning alignment alignments aligns alike alikeness alikenesses aliment
alimentary alimentation alimentations alimented alimenting aliments alimonies
alimony aline alined alinement alinements aliner aliners alines alining aliped
alipeds aliphatic aliquant aliquot aliquots alist alit aliteracies aliteracy
aliterate aliterates aliunde alive aliveness alivenesses aliya aliyah aliyahs
aliyas aliyos aliyot aliyoth alizarin alizarins alkahest alkahestic alkahests
alkali alkalic alkalies alkalified alkalifies alkalify alkalifying alkalimeter
alkalimeters alkalimetries alkalimetry alkalin alkaline alkalinities
alkalinity alkalinization alkalinizations alkalinize alkalinized alkalinizes
alkalinizing alkalis alkalise alkalised alkalises alkalising alkalize

 view all matches for this distribution


Games-Word-Wordlist-SGB

 view release on metacpan or  search on metacpan

lib/Games/Word/Wordlist/SGB.pm  view on Meta::CPAN

adieu adios adlib adman admen admit admix adobe adopt adore adorn adult
adzes aegis aerie affix afire afoot afore afoul after again agape agars
agate agave agent agile aging agley aglow agone agony agora agree agues
ahead ahhhh ahold ahoys aided aider aides ailed aimed aimer aioli aired
airer aisle aitch ajuga alack alarm album alder aleck aleph alert algae
algal algin alias alibi alien align alike alive alkyd alkyl allay alley
allot allow alloy aloes aloft aloha alone along aloof aloud alpha altar
alter altho altos alums alway amahs amass amaze amber ambit amble ameba
amend amens amide amigo amine amino amiss amity ammos among amour amped
ample amply amuck amuse amyls anded anent angel anger angle angry angst
anile anima anion anise ankhs ankle annas annex annoy annul annum anode

 view all matches for this distribution


Games-Worms

 view release on metacpan or  search on metacpan

lib/Games/Worms/Base.pm  view on Meta::CPAN


#--------------------------------------------------------------------------

sub try_move {
  my $worm = $_[0];
  return unless $worm->is_alive;
  if($Debug > 2) {
    sleep 1;
  }

  my $current_node = $worm->{'current_node'};

lib/Games/Worms/Base.pm  view on Meta::CPAN

  my $c = shift;
  $c = ref($c) || $c;
  my $it = bless { @_ }, $c;

  $it->{'uid'} = $uid++; # per-session unique, if we need it
  $it->{'is_alive'} = 1 unless defined $it->{'is_alive'};
  $it->{'color'} ||= $it->default_color;
  $it->{'segments_eaten'} = 0;
  $it->{'last_segment_eaten'} = 0;
  $it->{'memoize'} = $it->am_memoized;
  $it->{'can_zombie'} = $it->can_zombie;

lib/Games/Worms/Base.pm  view on Meta::CPAN

sub segments_eaten {
  my $it = $_[0];
  return $it->{'segments_eaten'};
}

sub is_alive { # regardless of whether undead or not
  my $it = $_[0];
  return $it->{'is_alive'};
}

#sub current_node {
#  my $it = $_[0];
#  return $it->{'current_node'};
#}

sub die {  # kill this worm.
  my $worm = $_[0];
  print " worm $worm dies\n" if $Debug;
  $worm->{'is_alive'} = 0;
  $worm->{'is_undead'} = 0;
}

sub really_die {  # kill this worm DEAD.
  my $worm = $_[0];
  print " worm $worm really dies\n" if $Debug;
  $worm->{'is_alive'} = 0;
  $worm->{'is_undead'} = 0;
}


sub eat_segment {

 view all matches for this distribution


Ganglia-Gmetric-XS

 view release on metacpan or  search on metacpan

example/apache-status  view on Meta::CPAN

        my @sc_order = (
                       'waiting',
                       'starting',
                       'reading_request',
                       'sending_reply',
                       'keepalive',
                       'dns_lookup',
                       'closing',
                       'logging',
                       'gracefully_finishing',
                       'idle',

example/apache-status  view on Meta::CPAN

        my %sc_byname = (
                         'waiting'              => '_',
                         'starting'             => 'S',
                         'reading_request'      => 'R',
                         'sending_reply'        => 'W',
                         'keepalive'            => 'K',
                         'dns_lookup'           => 'D',
                         'closing'              => 'C',
                         'logging'              => 'L',
                         'gracefully_finishing' => 'G',
                         'idle'                 => 'I',

 view all matches for this distribution


Gazelle

 view release on metacpan or  search on metacpan

lib/Gazelle.pm  view on Meta::CPAN


Gazelle supports following features:

=over

=item * Supports HTTP/1.1. (Without Keepalive support.)

=item * Ultra fast HTTP processing using picohttpparser.

=item * Uses accept4(2) if the operating system supports it.

 view all matches for this distribution


Gearman-Client-Async

 view release on metacpan or  search on metacpan

lib/Gearman/Client/Async.pm  view on Meta::CPAN

use warnings;
use Carp qw(croak);

use fields (
            'job_servers',   # arrayref of Gearman::Client::Async::Connection objects
            't_no_random',   # don't randomize job server to use:  use first alive one.
            't_offline_host', # hashref: hostname -> $bool, if host should act as offline, for testing
            );

use Danga::Socket 1.52;
use Gearman::Objects;

lib/Gearman/Client/Async.pm  view on Meta::CPAN

    my Gearman::Task $task = shift;

    my $try_again;
    $try_again = sub {

        my @job_servers = grep { $_->alive } @{$self->{job_servers}};
        warn "Alive servers: " . @job_servers . " out of " . @{$self->{job_servers}} . "\n" if DEBUGGING;
        unless (@job_servers) {
            $task->final_fail;
            $try_again = undef;
            return;

 view all matches for this distribution


( run in 2.595 seconds using v1.01-cache-2.11-cpan-14f38c9f855 )