games mastermind
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 2118
Games::Mastermind 0.03
Games::Mastermind is a simple framework for MasterMind games. more>>
Games::Mastermind is a simple framework for MasterMind games.
SYNOPSIS
use Games::Mastermind;
# the classic game
$mm = Games::Mastermind->new;
# make a guess
$marks = $game->play(qw( Y C W R ));
# results
print "You win!n" if $marks->[0] == $mm->holes();
# the game history is available at all times
$history = $mm->history();
$last_turn = $mm->history()->[-1];
# reset the game
$mm->reset();
Games::Mastermind is a very simple framework for running Mastermind games.
<<lessSYNOPSIS
use Games::Mastermind;
# the classic game
$mm = Games::Mastermind->new;
# make a guess
$marks = $game->play(qw( Y C W R ));
# results
print "You win!n" if $marks->[0] == $mm->holes();
# the game history is available at all times
$history = $mm->history();
$last_turn = $mm->history()->[-1];
# reset the game
$mm->reset();
Games::Mastermind is a very simple framework for running Mastermind games.
Download (0.014MB)
Added: 2007-01-04 License: Perl Artistic License Price:
1024 downloads
GNOME Mastermind 0.3
GNOME Mastermind is a Mastermind clone for GNOME Desktop. more>>
GNOME Mastermind is a Mastermind clone for GNOME Desktop.
GNOME Mastermind is a simple mastermind-like game that ive written mainly for fun and with learning purposes in spare time. Now it became quite stable and i decided to distribute it. Try it and give me some feedback.
<<lessGNOME Mastermind is a simple mastermind-like game that ive written mainly for fun and with learning purposes in spare time. Now it became quite stable and i decided to distribute it. Try it and give me some feedback.
Download (0.54MB)
Added: 2007-05-31 License: GPL (GNU General Public License) Price:
877 downloads
Games::Mastermind::Solver 0.02
Games::Mastermind::Solver is a Master Mind puzzle solver. more>>
Games::Mastermind::Solver is a Master Mind puzzle solver.
SYNOPSIS
# a trivial Mastermind solver
use Games::Mastermind;
use Games::Mastermind::Solver::BruteForce;
my $player = Games::Mastermind::Solver::BruteForce
->new( Games::Mastermind->new );
my $try;
print join( , @{$player->game->code} ), "nn";
until( $player->won || ++$try > 10 ) {
my( $win, $guess, $result ) = $player->move;
print join( , @$guess ),
,
B x $result->[0], W x $result->[1],
"n";
}
Games::Mastermind::Solver is a base class for Master Mind solvers.
<<lessSYNOPSIS
# a trivial Mastermind solver
use Games::Mastermind;
use Games::Mastermind::Solver::BruteForce;
my $player = Games::Mastermind::Solver::BruteForce
->new( Games::Mastermind->new );
my $try;
print join( , @{$player->game->code} ), "nn";
until( $player->won || ++$try > 10 ) {
my( $win, $guess, $result ) = $player->move;
print join( , @$guess ),
,
B x $result->[0], W x $result->[1],
"n";
}
Games::Mastermind::Solver is a base class for Master Mind solvers.
Download (0.004MB)
Added: 2007-01-03 License: Perl Artistic License Price:
1040 downloads
KMasterMind 2.2
KMasterMind is a mastermind game designed for K Desktop Environment. more>>
KMasterMind is a mastermind game designed for K Desktop Environment. KMasterMind game is written using Qt & KDE libraries.
KMasterMind is an intuitive game using the drag and drop mechanism for placing the pieces on site.
Enhancements:
- I added numerical labels to locate the position of the pieces and the ticks
- Tooltips for the toolbar buttons with the useful shortcuts
<<lessKMasterMind is an intuitive game using the drag and drop mechanism for placing the pieces on site.
Enhancements:
- I added numerical labels to locate the position of the pieces and the ticks
- Tooltips for the toolbar buttons with the useful shortcuts
Download (0.59MB)
Added: 2006-09-28 License: GPL (GNU General Public License) Price:
1121 downloads
Games::Mastermind::Solver::BruteForce 0.02
Games::Mastermind::Solver::BruteForce is a Master Mind puzzle solver. more>>
Games::Mastermind::Solver::BruteForce is a Master Mind puzzle solver.
SYNOPSIS
# See Games::Mastermind::Solver
Games::Mastermind::Solver::BruteForce uses the classical brute-force algorithm for solving Master Mind puzzles.
METHODS
remaining
$number = $player->remaining;
The number of possible solutions given the knowledge the player has accumulated.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
<<lessSYNOPSIS
# See Games::Mastermind::Solver
Games::Mastermind::Solver::BruteForce uses the classical brute-force algorithm for solving Master Mind puzzles.
METHODS
remaining
$number = $player->remaining;
The number of possible solutions given the knowledge the player has accumulated.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Download (0.004MB)
Added: 2007-01-04 License: Perl Artistic License Price:
1041 downloads
Games::Cards 1.45
Games::Cards is a Perl module for writing and playing card games. more>>
Games::Cards is a Perl module for writing and playing card games.
SYNOPSIS
use Games::Cards;
my $Rummy = new Games::Cards::Game;
# Create the correct deck for a game of Rummy.
my $Deck = new Games::Cards::Deck ($Rummy, "Deck");
# shuffle the deck and create the discard pile
$Deck->shuffle;
my $Discard = new Games::Cards::Queue "Discard Pile";
# Deal out the hands
foreach my $i (1 .. 3) {
my $hand = new Games::Cards::Hand "Player $i" ;
$Deck->give_cards($hand, 7);
$hand->sort_by_value;
push @Hands, $hand;
}
# print hands (e.g. "Player 1: AS 2C 3C 3H 10D QS KH")
foreach (@Hands) { print ($_->print("short"), "n") }
$Hands[1]->give_a_card ($Discard, "8D"); # discard 8 of diamonds
This module creates objects and methods to allow easier programming of card games in Perl. It allows you to do things like create decks of cards, have piles of cards, hands, and other sets of cards, turn cards face-up or face-down, and move cards from one set to another. Which is pretty much all you need for most card games.
<<lessSYNOPSIS
use Games::Cards;
my $Rummy = new Games::Cards::Game;
# Create the correct deck for a game of Rummy.
my $Deck = new Games::Cards::Deck ($Rummy, "Deck");
# shuffle the deck and create the discard pile
$Deck->shuffle;
my $Discard = new Games::Cards::Queue "Discard Pile";
# Deal out the hands
foreach my $i (1 .. 3) {
my $hand = new Games::Cards::Hand "Player $i" ;
$Deck->give_cards($hand, 7);
$hand->sort_by_value;
push @Hands, $hand;
}
# print hands (e.g. "Player 1: AS 2C 3C 3H 10D QS KH")
foreach (@Hands) { print ($_->print("short"), "n") }
$Hands[1]->give_a_card ($Discard, "8D"); # discard 8 of diamonds
This module creates objects and methods to allow easier programming of card games in Perl. It allows you to do things like create decks of cards, have piles of cards, hands, and other sets of cards, turn cards face-up or face-down, and move cards from one set to another. Which is pretty much all you need for most card games.
Download (0.089MB)
Added: 2007-01-03 License: Perl Artistic License Price:
1034 downloads
Games::Battleship 0.05
Games::Battleship - You sunk my battleship! more>>
Games::Battleship - "You sunk my battleship!"
SYNOPSIS
use Games::Battleship;
$g = Games::Battleship->new(qw( Gene Aeryk ));
$g->add_player(Stephanie);
$winner = $g->play();
print $winner->name(), " wins!n";
@player_objects = @{ $g->players };
$player_obj = $g->player(Professor Snape);
A Games::Battleship object represents a battleship game between players. Each has a fleet of vessles and operates with a pair of playing grids One is for their own fleet and one for where the enemy has been seen.
Everything is an object with default but mutable attributes. This way games can have two or more players each with a single fleet of custom vessles. These vessles are pretty simple and standard right now...
A game can be played with the handy play() method or for finer control, use individual methods of the Games::Battleship::* modules. See the distribution test script for working code examples.
<<lessSYNOPSIS
use Games::Battleship;
$g = Games::Battleship->new(qw( Gene Aeryk ));
$g->add_player(Stephanie);
$winner = $g->play();
print $winner->name(), " wins!n";
@player_objects = @{ $g->players };
$player_obj = $g->player(Professor Snape);
A Games::Battleship object represents a battleship game between players. Each has a fleet of vessles and operates with a pair of playing grids One is for their own fleet and one for where the enemy has been seen.
Everything is an object with default but mutable attributes. This way games can have two or more players each with a single fleet of custom vessles. These vessles are pretty simple and standard right now...
A game can be played with the handy play() method or for finer control, use individual methods of the Games::Battleship::* modules. See the distribution test script for working code examples.
Download (0.010MB)
Added: 2006-12-27 License: Perl Artistic License Price:
1035 downloads
Harem Games Slot Machine 3.13
Harem Games Slot Machine es un juego gratis de la popular tragaperras de casino donde juegas contra guapas modelos. El objetivo del juego Slot Machine... more>> <<less
Download (525KB)
Added: 2009-04-06 License: Freeware Price: Free
206 downloads
Games::Maze::SVG::Manual 0.75
Games::Maze::SVG::Manual is a Perl module with manual for the Games::Maze::SVG modules. more>>
Games::Maze::SVG::Manual is a Perl module with manual for the Games::Maze::SVG modules.
PURPOSE
The Games::Maze::SVG module supports the creation of 2-dimensional mazes in an SVG format suitable for printing or playing interactively. This module use the Games::Maze module to perform the actual work of creating the mazes.
HISTORY
During the middle of 2004, my son was extremely interested in mazes. We could not get enough mazes for him to solve. As a Perl programmer, I decided there must be some way to generate mazes and went to CPAN. I found Games::Maze. I printed a few pages of these mazes, and he was happy.
Unfortunately, the ASCII-based maze was not really satisfying for me. So I wrote code to convert the output of Games::Maze to SVG. This made much nicer looking mazes. I worked for a while to make the lines look better and to vary the corners to generate mazes that looked even better.
But the mazes were still missing something. So, I added the scripting support that would make the maze playable. I wrapped an HTML form around the generation program to allow it to be launched from the web.
I made this version available on my website. A friend of mine made some suggestions for individual visual changes that I incorporated. The design of the code did not change much during the next year. It was still a quick hacked wrapper around Games::Maze without much flexibility.
A year later, a comment on the SVG Developers mailing list made me dust off the code with an ey towards making a legitimate Perl module out of it. When I began looking at the code again, I realized that the original had been more of a hack than I remembered. The new version still could use some significant cleanup, but I am much happier with the overall design.
SYNOPSIS
use Games::Maze::SVG;
my $maze = Games::Maze::SVG->new( Rect, wallform => roundcorners );
my $svgout = $maze->toString();
OVERVIEW
The Games::Maze::SVG module can produce interactive or non-interactive mazes in SVG of three basic shapes. The shape of the maze is determined by the first parameter. This parameter is a string with one of the following values:
Rect
A maze with a rectangular overall shape and rectangular hallways.
RectHex
A maze with a rectangular overall shape and hallways made from hexagonal cells.
Hex
A maze with a hexagonal overall shape and hallways made from hexagonal cells.
The mazes can be further configured using a set of named parameters that follow the shape parameter. Most of these parameters are independent of the shape chosen. In addition, the mazeparams parameter supports passing parameters directly to the internal Games::Maze object which is used to create the maze.
<<lessPURPOSE
The Games::Maze::SVG module supports the creation of 2-dimensional mazes in an SVG format suitable for printing or playing interactively. This module use the Games::Maze module to perform the actual work of creating the mazes.
HISTORY
During the middle of 2004, my son was extremely interested in mazes. We could not get enough mazes for him to solve. As a Perl programmer, I decided there must be some way to generate mazes and went to CPAN. I found Games::Maze. I printed a few pages of these mazes, and he was happy.
Unfortunately, the ASCII-based maze was not really satisfying for me. So I wrote code to convert the output of Games::Maze to SVG. This made much nicer looking mazes. I worked for a while to make the lines look better and to vary the corners to generate mazes that looked even better.
But the mazes were still missing something. So, I added the scripting support that would make the maze playable. I wrapped an HTML form around the generation program to allow it to be launched from the web.
I made this version available on my website. A friend of mine made some suggestions for individual visual changes that I incorporated. The design of the code did not change much during the next year. It was still a quick hacked wrapper around Games::Maze without much flexibility.
A year later, a comment on the SVG Developers mailing list made me dust off the code with an ey towards making a legitimate Perl module out of it. When I began looking at the code again, I realized that the original had been more of a hack than I remembered. The new version still could use some significant cleanup, but I am much happier with the overall design.
SYNOPSIS
use Games::Maze::SVG;
my $maze = Games::Maze::SVG->new( Rect, wallform => roundcorners );
my $svgout = $maze->toString();
OVERVIEW
The Games::Maze::SVG module can produce interactive or non-interactive mazes in SVG of three basic shapes. The shape of the maze is determined by the first parameter. This parameter is a string with one of the following values:
Rect
A maze with a rectangular overall shape and rectangular hallways.
RectHex
A maze with a rectangular overall shape and hallways made from hexagonal cells.
Hex
A maze with a hexagonal overall shape and hallways made from hexagonal cells.
The mazes can be further configured using a set of named parameters that follow the shape parameter. Most of these parameters are independent of the shape chosen. In addition, the mazeparams parameter supports passing parameters directly to the internal Games::Maze object which is used to create the maze.
Download (0.035MB)
Added: 2007-01-08 License: Perl Artistic License Price:
601 downloads
Games::Go::AGATourn 1.035
AGATourn is a Perl extensions to ease the pain of using AGA tournament data files. more>>
AGATourn is a Perl extensions to ease the pain of using AGA tournament data files.
SYNOPSIS
use Games::Go::AGATourn;
my $agaTourn = Games::Go::AGATourn->new (options);
An AGATourn object represents a round or several rounds of an American Go Association tournament. There are methods for parsing several type of AGA file format:
tdlist
The entire list of AGA members including playing strength, club affiliation, and some other stuff.
register.tde
The starting point for a tournament. All players in a tournament must be entered in the register.tde file.
round results: 1.tde, 2.tde, etc.
Game results for each round of the tournament.
A note on IDs: in general, hashes in an AGATourn object are keyed by the AGA ID. An AGA ID consists of a three letter country specifier (like USA or TMP for temporary IDs) concatenated to an integer. Here we specify the three letter country specifier as the country and the integer part as the agaNum. The country concatenated with the agaNum is the ID. My ID for example is USA2122. IDs should be normalized (capitalize the country part and remove preceding 0s from the agaNum part) with the NormalizeID method (below).
Note also that some programs may accept limited integers in the agaNum part of the ID. Accelerat, for example, seems to accept only up to 32K (someone used a signed short somewhere?)
<<lessSYNOPSIS
use Games::Go::AGATourn;
my $agaTourn = Games::Go::AGATourn->new (options);
An AGATourn object represents a round or several rounds of an American Go Association tournament. There are methods for parsing several type of AGA file format:
tdlist
The entire list of AGA members including playing strength, club affiliation, and some other stuff.
register.tde
The starting point for a tournament. All players in a tournament must be entered in the register.tde file.
round results: 1.tde, 2.tde, etc.
Game results for each round of the tournament.
A note on IDs: in general, hashes in an AGATourn object are keyed by the AGA ID. An AGA ID consists of a three letter country specifier (like USA or TMP for temporary IDs) concatenated to an integer. Here we specify the three letter country specifier as the country and the integer part as the agaNum. The country concatenated with the agaNum is the ID. My ID for example is USA2122. IDs should be normalized (capitalize the country part and remove preceding 0s from the agaNum part) with the NormalizeID method (below).
Note also that some programs may accept limited integers in the agaNum part of the ID. Accelerat, for example, seems to accept only up to 32K (someone used a signed short somewhere?)
Download (0.015MB)
Added: 2007-01-02 License: Perl Artistic License Price:
1025 downloads
Games::Go::TDFinder 1.001
TDFinder is a widget to support preparing Go tournament registration. more>>
TDFinder is a widget to support preparing Go tournament registration.
SYNOPSIS
use Games::Go::TDFinder;
$tdFinder = $parent->Games::Go::TDFinder ( ? options ? );
TDFinder is a widget to assist in preparing a Go Tournament register.tde file in AGA (American Go Association) format. It consists of three main parts: a TDEntry widget at the bottom, a match list in the middle (which is an ROText widget), and the tde information at the top (A TextUndo widget).
The widget opens the TDLIST file for searching. Tournemant directors should download the most recent TDLIST from the AGA shortly before the tournament. The most recent TDLIST is available from the AGA at: http:www.usgo.org
Typing search keys into the TDEntry field causes the TDFinder to search through the TDLIST looking for matches.
When the number of matches is small enough to fit into the match list ROText widget, they are posted there. Individual TDLIST entries can be selected either by further refining the search keys, or by using the Up/Down arrow keys. Typing Enter, double clicking a match (BUGBUG: TBD), or dragging a match to the tde text widget (BUGBUG: TBD) transfers a match to the tde file.
The caller is responsible for make sure the final register.tde file corresponds to the information in the tde part of the TDFinder widget.
<<lessSYNOPSIS
use Games::Go::TDFinder;
$tdFinder = $parent->Games::Go::TDFinder ( ? options ? );
TDFinder is a widget to assist in preparing a Go Tournament register.tde file in AGA (American Go Association) format. It consists of three main parts: a TDEntry widget at the bottom, a match list in the middle (which is an ROText widget), and the tde information at the top (A TextUndo widget).
The widget opens the TDLIST file for searching. Tournemant directors should download the most recent TDLIST from the AGA shortly before the tournament. The most recent TDLIST is available from the AGA at: http:www.usgo.org
Typing search keys into the TDEntry field causes the TDFinder to search through the TDLIST looking for matches.
When the number of matches is small enough to fit into the match list ROText widget, they are posted there. Individual TDLIST entries can be selected either by further refining the search keys, or by using the Up/Down arrow keys. Typing Enter, double clicking a match (BUGBUG: TBD), or dragging a match to the tde text widget (BUGBUG: TBD) transfers a match to the tde file.
The caller is responsible for make sure the final register.tde file corresponds to the information in the tde part of the TDFinder widget.
Download (0.062MB)
Added: 2007-01-02 License: GPL (GNU General Public License) Price:
1025 downloads
Games::GuessWord 0.15
Games::GuessWord is a guess the letters in a word (ie Hangman). more>>
Games::GuessWord is a guess the letters in a word (ie Hangman).
SYNOPSIS
use Games::GuessWord;
my $g = Games::GuessWord->new(file => "/path/to/wordlist");
print "Score: " . $g->score . "n";
print "Chances: " . $g->chances . "n";
print "Answer: " . $g->answer . "n";
my @guesses = $g->guesses;
$g->guess("t");
# ...
if ($g->won) {
print "You won!n";
$g->new_word;
}
This module is a simple wrapper around a word guessing game. You have to guess the word by guessing letters in the word, and is otherwise known as Hangman.
<<lessSYNOPSIS
use Games::GuessWord;
my $g = Games::GuessWord->new(file => "/path/to/wordlist");
print "Score: " . $g->score . "n";
print "Chances: " . $g->chances . "n";
print "Answer: " . $g->answer . "n";
my @guesses = $g->guesses;
$g->guess("t");
# ...
if ($g->won) {
print "You won!n";
$g->new_word;
}
This module is a simple wrapper around a word guessing game. You have to guess the word by guessing letters in the word, and is otherwise known as Hangman.
Download (0.004MB)
Added: 2007-01-06 License: Perl Artistic License Price:
1024 downloads
Games::LMSolve::Base 0.8.1
Games::LMSolve::Base is a base class for puzzle solvers. more>>
Games::LMSolve::Base is a base class for puzzle solvers.
SYNOPSIS
package MyPuzzle::Solver;
use Games::LMSolve::Base;
@ISA = qw(Games::LMSolve::Base);
# Override these methods:
sub input_board { ... }
sub pack_state { ... }
sub unpack_state { ... }
sub display_state { ... }
sub check_if_final_state { ... }
sub enumerate_moves { ... }
sub perform_move { ... }
# Optionally:
sub render_move { ... }
sub check_if_unsolvable { ... }
package main;
my $self = MyPuzzle::Solver->new();
$self->solve_board($filename);
This class implements a generic solver for single player games. In order to use it, one must inherit from it and implement some abstract methods. Afterwards, its interface functions can be invoked to actually solve the game.
<<lessSYNOPSIS
package MyPuzzle::Solver;
use Games::LMSolve::Base;
@ISA = qw(Games::LMSolve::Base);
# Override these methods:
sub input_board { ... }
sub pack_state { ... }
sub unpack_state { ... }
sub display_state { ... }
sub check_if_final_state { ... }
sub enumerate_moves { ... }
sub perform_move { ... }
# Optionally:
sub render_move { ... }
sub check_if_unsolvable { ... }
package main;
my $self = MyPuzzle::Solver->new();
$self->solve_board($filename);
This class implements a generic solver for single player games. In order to use it, one must inherit from it and implement some abstract methods. Afterwards, its interface functions can be invoked to actually solve the game.
Download (0.021MB)
Added: 2007-01-06 License: Perl Artistic License Price:
1021 downloads
Games::AlphaBeta::Reversi 0.4.6
Games::AlphaBeta::Reversi is a Reversi position class for use with Games::AlphaBeta. more>>
Games::AlphaBeta::Reversi is a Reversi position class for use with Games::AlphaBeta.
SYNOPSIS
package My::Reversi;
use base qw(Games::AlphaBeta::Reversi);
# implement drawing routine
sub draw { ... }
package main;
use My::Reversi;
use Games::AlphaBeta;
my ($p, $g);
$p = My::Reversi->new;
$g = Games::AlphaBeta->new($p);
while ($p = $g->abmove) {
$p->draw;
}
This module implements a position-object suitable for use with Games::AlphaBeta. It inherits from the Games::AlphaBeta::Position base class, so be sure to read its documentation. The methods implemented there will not be described here.
<<lessSYNOPSIS
package My::Reversi;
use base qw(Games::AlphaBeta::Reversi);
# implement drawing routine
sub draw { ... }
package main;
use My::Reversi;
use Games::AlphaBeta;
my ($p, $g);
$p = My::Reversi->new;
$g = Games::AlphaBeta->new($p);
while ($p = $g->abmove) {
$p->draw;
}
This module implements a position-object suitable for use with Games::AlphaBeta. It inherits from the Games::AlphaBeta::Position base class, so be sure to read its documentation. The methods implemented there will not be described here.
Download (0.012MB)
Added: 2007-01-04 License: Perl Artistic License Price:
1023 downloads
Games::Baseball::Scorecard 0.03
Games::Baseball::Scorecard is a Perl module. more>>
Games::Baseball::Scorecard is a Perl module.
SYNOPSIS
my $score = Games::Baseball::Scorecard->new($dir, $name, {
color => [ .4, .4, .4 ], # grey
fonts => [ # Myriad Condensed regular/bold
[ myriadrcrrl => 9 ],
[ myriadrcbrl => 14 ],
[ myriadrcrrl => 14 ],
[ myriadrcbrl => 22 ],
],
});
# fill initial scorecard out
$s->init({
scorer => Pudge,
date => 2004-10-24, 20:05-23:25,
at => Fenway Park, Boston,
temp => 48 clear,
wind => 7 to RF,
att => 35,001,
home => {
team => Boston Red Sox,
starter => 38, # jersey number
lineup => [
# [ num, position ],
[ 18, 8 ], # Damon, starting at CF
# ...
],
roster => {
# num => name
18 => Damon, Johnny,
38 => Schilling, Curt,
# ...
},
},
away => {
team => St. Louis Cardinals,
# ...
}
});
# draw the game
$s->inn; # new inning / end of last inning
$s->ab; # new at-bat
# works to full count
$s->pitches(qw(s b s b b f));
# struck out looking
$s->out(!K);
$s->ab;
# home run to left-center
$s->hit(4, lc);
# calculate/draw stats
$self->totals;
# finish the job
$s->generate;
# open final PDF
$s->pdfopen;
Games::Baseball::Scorecard is a frontend to a PDF scorecard written in Metapost by Christopher Swingley (http://www.frontier.iarc.uaf.edu/~cswingle/baseball/scorecards.php). That scorecard is drawn out, and has a nice API for actually drawing out the elements of the game: all the ball, strikes, outs, etc.
Being Metapost, it is laborious to do all this. So this module provides a nice frontend, that also keeps track of balls and strikes and hits and runs and outs and more, making input of the game quite simple and efficient.
This module does not include the entire API, but most of it. Patches and ideas welcome. Feel free to call output directly if you want to generate Metapost on your own, or to modify the $SCORECARD variable (which contains the base Metapost code), or the $TEX (single page) and $TEXD (duplex) TeX files.
I wont give a tutorial on scoring baseball games, or on Metapost, below. Seek other resources (Swingleys URL above has a nice tutorial on scoring baseball games, using the scorecard he designed, which is what were using here).
<<lessSYNOPSIS
my $score = Games::Baseball::Scorecard->new($dir, $name, {
color => [ .4, .4, .4 ], # grey
fonts => [ # Myriad Condensed regular/bold
[ myriadrcrrl => 9 ],
[ myriadrcbrl => 14 ],
[ myriadrcrrl => 14 ],
[ myriadrcbrl => 22 ],
],
});
# fill initial scorecard out
$s->init({
scorer => Pudge,
date => 2004-10-24, 20:05-23:25,
at => Fenway Park, Boston,
temp => 48 clear,
wind => 7 to RF,
att => 35,001,
home => {
team => Boston Red Sox,
starter => 38, # jersey number
lineup => [
# [ num, position ],
[ 18, 8 ], # Damon, starting at CF
# ...
],
roster => {
# num => name
18 => Damon, Johnny,
38 => Schilling, Curt,
# ...
},
},
away => {
team => St. Louis Cardinals,
# ...
}
});
# draw the game
$s->inn; # new inning / end of last inning
$s->ab; # new at-bat
# works to full count
$s->pitches(qw(s b s b b f));
# struck out looking
$s->out(!K);
$s->ab;
# home run to left-center
$s->hit(4, lc);
# calculate/draw stats
$self->totals;
# finish the job
$s->generate;
# open final PDF
$s->pdfopen;
Games::Baseball::Scorecard is a frontend to a PDF scorecard written in Metapost by Christopher Swingley (http://www.frontier.iarc.uaf.edu/~cswingle/baseball/scorecards.php). That scorecard is drawn out, and has a nice API for actually drawing out the elements of the game: all the ball, strikes, outs, etc.
Being Metapost, it is laborious to do all this. So this module provides a nice frontend, that also keeps track of balls and strikes and hits and runs and outs and more, making input of the game quite simple and efficient.
This module does not include the entire API, but most of it. Patches and ideas welcome. Feel free to call output directly if you want to generate Metapost on your own, or to modify the $SCORECARD variable (which contains the base Metapost code), or the $TEX (single page) and $TEXD (duplex) TeX files.
I wont give a tutorial on scoring baseball games, or on Metapost, below. Seek other resources (Swingleys URL above has a nice tutorial on scoring baseball games, using the scorecard he designed, which is what were using here).
Download (0.34MB)
Added: 2006-07-31 License: GPL (GNU General Public License) Price:
710 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above games mastermind search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed