Games-Perlwar
view release on metacpan or search on metacpan
lib/Games/Perlwar/Rules.pod view on Meta::CPAN
Array holding the facade of all agents, positioned relatively to the current
agent.
=item $O (big oh)
The agent's true master.
=item $S, $I, $i
the game's parameters $S (max agent's size) and $I (max # of iterations), plus the current iteration $i.
Those are local variables and can't be used to modified the game parameters, obviously.
=back
=head3 Outcomes
If the agent segfaults, it is erased and the cell ownership is cleared.
If the agent executes without segfault'ing, the changes made to $_ (that is, on the snippet itself)
are brought to the Array.
lib/Games/Perlwar/Shell.pm view on Meta::CPAN
},
pwd => {
desc => "print current working directory",
proc => \&do_pwd,
},
});
### run
$shell->add_commands({
run => {
desc => 'run iterations of the game',
proc => \&do_run,
}
});
### exec, info
$shell->add_commands({
eval => {
desc => 'execute arbitrary perl code',
proc => sub { print eval( join ' ', @_ ), "\n" },
},
web/stylesheets/configuration.xps view on Meta::CPAN
<h1>PerlWar : <%= findvalue( '//configuration/title/text()' ) %></h1>
<% use Games::PerlWar; %>
<p>using Perlwar version <%= $Games::PerlWar::VERSION %>
</p>
<h2>settings</h2>
<dl>
<dt>Game length<dt><dd><%= findvalue( '//configuration/gameLength/text()' ) %> iterations</dd>
<dt>Array size</dt><dd><%= findvalue( '//configuration/theArraySize/text()' ) %> cells</dd>
<dt>Agent maximal size</dt><dd><%= findvalue( '//configuration/agentMaxSize/text()' ) %> characters</dd>
<% if ( my $m = findvalue( '//configuration/mamboDecrement/text()' ) ) { %>
<dt>mambo option</dt><dd>enabled</dd>
<dt>mambo decrement per turn</dt><dd><%= $m %></dd>
<% } %>
</dl>
<% if ( my $n = findvalue( '//configuration/note/text()' ) ) { %>
( run in 0.825 second using v1.01-cache-2.11-cpan-71847e10f99 )