games cards 1.45
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 2678
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
Penguin Cards 1.0
Penguin Cards project is a card game. more>>
Penguin Cards project is a card game.
PenguinCards is a two-player card game. The aim is to find the pairs of cards on the board. The one who finds out more card pairs is the winner.
PenguinCards is a java-based game.
If you are unhappy with images on the cards, then simply copy your cards into images/pictures/penguins directory. That is it!
Enhancements:
- Initial release
<<lessPenguinCards is a two-player card game. The aim is to find the pairs of cards on the board. The one who finds out more card pairs is the winner.
PenguinCards is a java-based game.
If you are unhappy with images on the cards, then simply copy your cards into images/pictures/penguins directory. That is it!
Enhancements:
- Initial release
Download (0.12MB)
Added: 2006-11-30 License: GPL (GNU General Public License) Price:
1062 downloads
Games::Cards::Poker 1.2.565CHh5
Games::Cards::Poker is a Perl module for Pure Perl Poker functions. more>>
Games::Cards::Poker is a Perl module for Pure Perl Poker functions.
SYNOPSIS
use Games::Cards::Poker;
# Deal Four (4) players hands and score them...
my $players = 4; # number of players to get hands dealt
my $hand_size = 5; # number of cards to deal to each player
my @hands = ();# player hand data
my @deck = Shuffle(Deck());
while($players--) {
push(@{$hands[$players]}, pop(@deck)) foreach(1..$hand_size);
printf("Player$players score:%4d hand:@{$hands[$players]}n",
ScoreHand(@{$hands[$players]}));
}
Poker provides a few functions for creating decks of cards and manipulating them for simple Poker games or simulations.
<<lessSYNOPSIS
use Games::Cards::Poker;
# Deal Four (4) players hands and score them...
my $players = 4; # number of players to get hands dealt
my $hand_size = 5; # number of cards to deal to each player
my @hands = ();# player hand data
my @deck = Shuffle(Deck());
while($players--) {
push(@{$hands[$players]}, pop(@deck)) foreach(1..$hand_size);
printf("Player$players score:%4d hand:@{$hands[$players]}n",
ScoreHand(@{$hands[$players]}));
}
Poker provides a few functions for creating decks of cards and manipulating them for simple Poker games or simulations.
Download (0.072MB)
Added: 2006-09-19 License: Perl Artistic License Price:
1138 downloads
Games::Euchre 1.02
Games::Euchre is an Euchre card game for humans and computers. more>>
Games::Euchre is an Euchre card game for humans and computers.
SYNOPSIS
Simply run my game wrapper:
% euchre.pl
or write your own:
use Games::Euchre;
use Games::Euchre::AI::Simple;
use Games::Euchre::AI::Human;
my $game = Games::Euchre->new();
foreach my $i (1..3) {
$game->setAI($i, Games::Euchre::AI::Simple->new());
}
$game->setAI(4, Games::Euchre::AI::Human->new());
$game->playGame();
my @scores = sort {$b $a} $game->getScores();
print("The winner is " . $game->getWinner()->getName() . " with a score of " .
"$scores[0] to $scores[1]n");
This software implements the card game of Euchre. The game is played with four players composing two teams. Any of the four players can be human or computer players, but more than one human is not well supported yet.
The Games::Euchre::AI module implements a simple framework for adding new classes of human interfaces or computer opponents. I recomment that AI writers use Games::Euchre::AI::Simple (a REALLY dumb computer opponent) as starting point.
Aside from the ::AI class and its descendents, this package also implements the following classes: Games::Euchre::Team, Games::Euchre::Player and Games::Euchre::Trick.
<<lessSYNOPSIS
Simply run my game wrapper:
% euchre.pl
or write your own:
use Games::Euchre;
use Games::Euchre::AI::Simple;
use Games::Euchre::AI::Human;
my $game = Games::Euchre->new();
foreach my $i (1..3) {
$game->setAI($i, Games::Euchre::AI::Simple->new());
}
$game->setAI(4, Games::Euchre::AI::Human->new());
$game->playGame();
my @scores = sort {$b $a} $game->getScores();
print("The winner is " . $game->getWinner()->getName() . " with a score of " .
"$scores[0] to $scores[1]n");
This software implements the card game of Euchre. The game is played with four players composing two teams. Any of the four players can be human or computer players, but more than one human is not well supported yet.
The Games::Euchre::AI module implements a simple framework for adding new classes of human interfaces or computer opponents. I recomment that AI writers use Games::Euchre::AI::Simple (a REALLY dumb computer opponent) as starting point.
Aside from the ::AI class and its descendents, this package also implements the following classes: Games::Euchre::Team, Games::Euchre::Player and Games::Euchre::Trick.
Download (0.021MB)
Added: 2007-01-03 License: GPL (GNU General Public License) Price:
1034 downloads
Games::Bingo::Card 0.13
Games::Bingo::Card is a helper class for Games::Bingo. more>>
Games::Bingo::Card is a helper class for Games::Bingo.
SYNOPSIS
use Games::Bingo::Card;
my $b = Games::Bingo-E new(90);
my $card = Games::Bingo::Card-E new($b);
my $bingo = Games::Bingo-E new(90);
$card-E validate($bingo);
use Games::Bingo::Print::Card;
my $p = Games::Bingo::Print::Card-E new();
$p-E populate();
The Games::Bingo::Card class suits the simple purpose of being able to generate bingo cards and validating whether they are valid in during a game where a player indicate victory.
It is also used by Games::Bingo::Print to hold the generated bingo cards before they are printed.
<<lessSYNOPSIS
use Games::Bingo::Card;
my $b = Games::Bingo-E new(90);
my $card = Games::Bingo::Card-E new($b);
my $bingo = Games::Bingo-E new(90);
$card-E validate($bingo);
use Games::Bingo::Print::Card;
my $p = Games::Bingo::Print::Card-E new();
$p-E populate();
The Games::Bingo::Card class suits the simple purpose of being able to generate bingo cards and validating whether they are valid in during a game where a player indicate victory.
It is also used by Games::Bingo::Print to hold the generated bingo cards before they are printed.
Download (0.020MB)
Added: 2007-01-04 License: Perl Artistic License Price:
1024 downloads
Cardpics 0.4
Cardpics project is a set of free cards sets. more>>
Cardpics project is a set of free cards sets.
If you are programming a card game and are looking for free cards, Cardpics was made for you! Get a set of cards and include them in your project, as soon as your project is free.
Installing
1. `cd to the directory containing the packages source code and type
`./configure to configure the package for your system. If youre
using `csh on an old version of System V, you might need to type
`sh ./configure instead to prevent `csh from trying to execute
`configure itself.
Running `configure takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make to compile the package.
3. Optionally, type `make check to run any self-tests that come with
the package.
4. Type `make install to install the programs and any data files and
documentation.
<<lessIf you are programming a card game and are looking for free cards, Cardpics was made for you! Get a set of cards and include them in your project, as soon as your project is free.
Installing
1. `cd to the directory containing the packages source code and type
`./configure to configure the package for your system. If youre
using `csh on an old version of System V, you might need to type
`sh ./configure instead to prevent `csh from trying to execute
`configure itself.
Running `configure takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make to compile the package.
3. Optionally, type `make check to run any self-tests that come with
the package.
4. Type `make install to install the programs and any data files and
documentation.
Download (0.15MB)
Added: 2006-08-31 License: GPL (GNU General Public License) Price:
1149 downloads
Nebula Cards 0.7
Nebula Cards project is a card game engine. more>>
Nebula Cards project is a card game engine.
Nebula Cards is a networked, modular card game engine written in pure Java.
The game rules, user interfaces, and computer players all take the form of pluggable Java classes, and most four-player, trick-taking games can be implemented.
It currently includes Spades and Hearts, with a computer player for Spades.
Enhancements:
- last release before a major restructuring.
- added Game class in a backward-compatible way.
- added util.proc to house the new GameProcedure library.
- added util.ui.GraphicalCardSelector (untested).
<<lessNebula Cards is a networked, modular card game engine written in pure Java.
The game rules, user interfaces, and computer players all take the form of pluggable Java classes, and most four-player, trick-taking games can be implemented.
It currently includes Spades and Hearts, with a computer player for Spades.
Enhancements:
- last release before a major restructuring.
- added Game class in a backward-compatible way.
- added util.proc to house the new GameProcedure library.
- added util.ui.GraphicalCardSelector (untested).
Download (MB)
Added: 2006-11-15 License: GPL (GNU General Public License) Price:
1075 downloads
Wolvix Games 1.0.4
Wolvix Games is a new edition of the Wolvix live CD, featuring over 50 games. more>>
Wolvix is a GNU/Linux LiveCD built from SLAX. Wolvix is a desktop oriented distribution made to fit the needs from regular to advanced desktop users.
Along with the applications youll get some of the best free Linux games. (No 3D gfx card required).
Games Edition features over 50 games in different categories, four emulators and quite a few desktop applications.
You wont find World of Warcraft or Half-Life 2 on the CD, but Ive tried to include some of the finest free Linux games and I think there should be a game or two for most people, Ive even added dopewars for your grandma.
None of the games require 3D drivers, so you should be able to play most games on any graphics card
<<lessAlong with the applications youll get some of the best free Linux games. (No 3D gfx card required).
Games Edition features over 50 games in different categories, four emulators and quite a few desktop applications.
You wont find World of Warcraft or Half-Life 2 on the CD, but Ive tried to include some of the finest free Linux games and I think there should be a game or two for most people, Ive even added dopewars for your grandma.
None of the games require 3D drivers, so you should be able to play most games on any graphics card
Download (MB)
Added: 2005-12-12 License: GPL (GNU General Public License) Price:
1428 downloads
Games::Goban 1.100
Games::Goban is a board for playing go, renju, othello, etc. more>>
Games::Goban is a board for playing go, renju, othello, etc.
SYNOPSIS
use Games::Goban;
my $board = new Games::Goban (
size => 19,
game => "go",
white => "Seigen, Go",
black => "Minoru, Kitani",
referee => &Games::Goban::Rules::Go,
);
$board->move("pd"); $board->move("dd");
print $board->as_sgf;
This is a generic module for handling goban-based board games. Theoretically, it can be used to handle many of the other games which can use Smart Game Format (SGF) but I want to keep it reasonably restricted in order to keep it simple.
<<lessSYNOPSIS
use Games::Goban;
my $board = new Games::Goban (
size => 19,
game => "go",
white => "Seigen, Go",
black => "Minoru, Kitani",
referee => &Games::Goban::Rules::Go,
);
$board->move("pd"); $board->move("dd");
print $board->as_sgf;
This is a generic module for handling goban-based board games. Theoretically, it can be used to handle many of the other games which can use Smart Game Format (SGF) but I want to keep it reasonably restricted in order to keep it simple.
Download (0.015MB)
Added: 2007-01-06 License: Perl Artistic License Price:
1035 downloads
Games::Euchre::AI 1.02
Games::Euchre::AI is a Player API for Euchre card game. more>>
Games::Euchre::AI is a Player API for Euchre card game.
This class implements a skeletal Euchre player programming interface. Subclasses can be created quite easily as interactive interfaces or AI computer players.
If you wish to write your own computer player, I recommend you start with Games::Euchre::AI::Simple. If you wish to write your own human interface, I recommend you start with Games::Euchre::AI::Human.
CLASS METHODS
new
Create and initialize a new Euchre AI. This object is implemented as an empty hash. Subclasses may wish to use this hash for state storage.
INSTANCE METHODS
Actions
The following methods are called in the course of the game where the AI (or human) has to make a decision. The state of the game is always passed in a hashreference. The following fields are always available:
name is the name of the current player. This is useful for output messages.
names is a hash relating player number to player name for all four players.
debug is a boolean indicating if we are debugging game or the AIs. Your AI may wish to provide verbose output if debugging is going on.
bid STATEHASH
Choose trump or pass. The relevent details of the current state of the game are provided in a hash reference. Here is an example of that data structure:
{
name => Player 1,
names => {1 => Player 1, 2 => P2, 3 => P3, 4 => Fred},
number => 1,
turnedUp => KH,
passes => 1,
ourScore => 2,
theirScore => 4,
winScore => 10,
hangdealer => false,
notrump => false,
hand => [JS, QH, 9S, KC, AD],
debug => false,
}
turnedUp is the suit and value of the card on the top of the blind. This will be undef on the second round of bidding.
passes says how many people have passed so far
hangdealer is a boolean saying whether the hang-the-dealer optional rule is in effect
notrump is a boolean saying whether the no trump optional rule is in effect
This function must return one of: H, D, C, S, N, HA, DA, CA, SA, NA, or undef
N means no trump, A means alone, undef means pass. Not all of these are legal at any given round! Use the isLegalBid() method below if you are unsure.
pickItUp STATEHASH
If this is called, you are the dealer and someone called trump. Choose which card from your hand to discard in exchange for the top card of the blind. The relevent details of the current state of the game are provided in a hash reference. Here is an example of that data structure:
{
name => Player 1,
names => {1 => Player 1, 2 => P2, 3 => P3, 4 => Fred},
number => 1,
turnedUp => KH,
trump => H,
bidder => 2,
weBid => false,
usAlone => false,
themAlone => false,
hand => [JS, QH, 9S, KC, AD],
debug => false,
}
This method should return the 0-based index of the card to trade for the turnedUp card. Namely, this in the index of the hand array for the card that you choose.
playCard STATEHASH
Choose which card from your hand to play on this trick. The relevent details of the current state of the game are provided in a hash reference. Here is an example of that data structure:
{
name => Player 1,
names => {1 => Player 1, 2 => P2, 3 => P3, 4 => Fred},
number => 1,
trump => H,
bidder => 2,
weBid => true,
usAlone => false,
themAlone => false,
trick => 2,
ourTricks => 0,
theirTricks => 1,
ourScore => 2,
theirScore => 4,
winScore => 10,
played => [10H, 9H, QC],
playedBy => [2, 3, 4, 1],
hand => [JH, AH, AS, KS],
debug => false,
}
playedBy is an arrayref of numbers of the players in the order they will play. Without this, the alone possibility makes it hard to tell who played what.
Any needed information not stored here (like who was the dealer, what was the turn-up card, what happened in the first trick) is YOUR responsibility to collect and store in your instance.
This method should return the 0-based index of the card to play. Namely, this in the index of the hand array for the card that you choose.
<<lessThis class implements a skeletal Euchre player programming interface. Subclasses can be created quite easily as interactive interfaces or AI computer players.
If you wish to write your own computer player, I recommend you start with Games::Euchre::AI::Simple. If you wish to write your own human interface, I recommend you start with Games::Euchre::AI::Human.
CLASS METHODS
new
Create and initialize a new Euchre AI. This object is implemented as an empty hash. Subclasses may wish to use this hash for state storage.
INSTANCE METHODS
Actions
The following methods are called in the course of the game where the AI (or human) has to make a decision. The state of the game is always passed in a hashreference. The following fields are always available:
name is the name of the current player. This is useful for output messages.
names is a hash relating player number to player name for all four players.
debug is a boolean indicating if we are debugging game or the AIs. Your AI may wish to provide verbose output if debugging is going on.
bid STATEHASH
Choose trump or pass. The relevent details of the current state of the game are provided in a hash reference. Here is an example of that data structure:
{
name => Player 1,
names => {1 => Player 1, 2 => P2, 3 => P3, 4 => Fred},
number => 1,
turnedUp => KH,
passes => 1,
ourScore => 2,
theirScore => 4,
winScore => 10,
hangdealer => false,
notrump => false,
hand => [JS, QH, 9S, KC, AD],
debug => false,
}
turnedUp is the suit and value of the card on the top of the blind. This will be undef on the second round of bidding.
passes says how many people have passed so far
hangdealer is a boolean saying whether the hang-the-dealer optional rule is in effect
notrump is a boolean saying whether the no trump optional rule is in effect
This function must return one of: H, D, C, S, N, HA, DA, CA, SA, NA, or undef
N means no trump, A means alone, undef means pass. Not all of these are legal at any given round! Use the isLegalBid() method below if you are unsure.
pickItUp STATEHASH
If this is called, you are the dealer and someone called trump. Choose which card from your hand to discard in exchange for the top card of the blind. The relevent details of the current state of the game are provided in a hash reference. Here is an example of that data structure:
{
name => Player 1,
names => {1 => Player 1, 2 => P2, 3 => P3, 4 => Fred},
number => 1,
turnedUp => KH,
trump => H,
bidder => 2,
weBid => false,
usAlone => false,
themAlone => false,
hand => [JS, QH, 9S, KC, AD],
debug => false,
}
This method should return the 0-based index of the card to trade for the turnedUp card. Namely, this in the index of the hand array for the card that you choose.
playCard STATEHASH
Choose which card from your hand to play on this trick. The relevent details of the current state of the game are provided in a hash reference. Here is an example of that data structure:
{
name => Player 1,
names => {1 => Player 1, 2 => P2, 3 => P3, 4 => Fred},
number => 1,
trump => H,
bidder => 2,
weBid => true,
usAlone => false,
themAlone => false,
trick => 2,
ourTricks => 0,
theirTricks => 1,
ourScore => 2,
theirScore => 4,
winScore => 10,
played => [10H, 9H, QC],
playedBy => [2, 3, 4, 1],
hand => [JH, AH, AS, KS],
debug => false,
}
playedBy is an arrayref of numbers of the players in the order they will play. Without this, the alone possibility makes it hard to tell who played what.
Any needed information not stored here (like who was the dealer, what was the turn-up card, what happened in the first trick) is YOUR responsibility to collect and store in your instance.
This method should return the 0-based index of the card to play. Namely, this in the index of the hand array for the card that you choose.
Download (0.021MB)
Added: 2006-12-26 License: Perl Artistic License Price:
1034 downloads
Hearts 1.98
Hearts is a card game with beta support for network play. more>>
Hearts is a little card game for four persons.
A computer version of the game comes with Microsoft Windows and is a pretty popular little thing. When I switched to using Linux, I really wanted to play it, but I didnt find anything at all, so I decided to write it myself and here it is.
Enhancements:
Fixed all known bugs:
- The card passing was always to the right.
- Portability issue regarding setting the random seed (std::random_shuffle + std::srand issue).
- A lot of processes were left running.
- Only one match (ie, a series of games until a player gets 100 points) was possible.
- Status bar tells the user what he he should do at every step (play, give cards right, etc.)
<<lessA computer version of the game comes with Microsoft Windows and is a pretty popular little thing. When I switched to using Linux, I really wanted to play it, but I didnt find anything at all, so I decided to write it myself and here it is.
Enhancements:
Fixed all known bugs:
- The card passing was always to the right.
- Portability issue regarding setting the random seed (std::random_shuffle + std::srand issue).
- A lot of processes were left running.
- Only one match (ie, a series of games until a player gets 100 points) was possible.
- Status bar tells the user what he he should do at every step (play, give cards right, etc.)
Download (0.55MB)
Added: 2005-06-20 License: GPL (GNU General Public License) Price:
1597 downloads
SVG-cards 2.0.1
SVG-cards is a set of playing cards made from pure SVG with all kings, queens, jacks, numbers, jokers, and backs of cards. more>>
SVG-cards is a set of playing cards made from pure SVG with all kings, queens, jacks, numbers, jokers, and backs of cards.
You can use SVG-cards everywhere you like : Web pages, games, the GNOME desktop, the KDE desktop, and so on...
You can print them on your color printer and make real cards or T-shirts.
The kings, queens and jacks are based on the french representation, because I find them beautiful. You can access to each either by rendering the file into a pixmap and clipping each card or by using their name with a DOM interface. All cards are inside a SVG group.
Example :
the king of spade is inside this group :
< g id="king_spade" >
...
< /g >
Names are the following :
black_joker
red_joker
back
{king,queen,jack}_{club,diamond,heart,spade}
{1,2,3,4,5,6,7,8,9,10}_{club,diamond,heart,spade}
Examples :
- the ace of club is 1_club
- the queen of diamond is queen_diamond
Enhancements:
- A bug that prevented SVG cards from being displayed in Firefox and Adobe Illustrator was fixed.
<<lessYou can use SVG-cards everywhere you like : Web pages, games, the GNOME desktop, the KDE desktop, and so on...
You can print them on your color printer and make real cards or T-shirts.
The kings, queens and jacks are based on the french representation, because I find them beautiful. You can access to each either by rendering the file into a pixmap and clipping each card or by using their name with a DOM interface. All cards are inside a SVG group.
Example :
the king of spade is inside this group :
< g id="king_spade" >
...
< /g >
Names are the following :
black_joker
red_joker
back
{king,queen,jack}_{club,diamond,heart,spade}
{1,2,3,4,5,6,7,8,9,10}_{club,diamond,heart,spade}
Examples :
- the ace of club is 1_club
- the queen of diamond is queen_diamond
Enhancements:
- A bug that prevented SVG cards from being displayed in Firefox and Adobe Illustrator was fixed.
Download (0.34MB)
Added: 2006-06-30 License: LGPL (GNU Lesser General Public License) Price:
1219 downloads
Games::Euchre::Trick 1.02
Games::Euchre::Trick is a trick class for Euchre card game. more>>
Games::Euchre::Trick is a trick class for Euchre card game.
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 playCard() method for each player in turn in its play() method, usually called from the Games::Euchre->playHand() method.
<<lessOnly 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 playCard() method for each player in turn in its play() method, usually called from the Games::Euchre->playHand() method.
Download (0.021MB)
Added: 2007-01-02 License: Perl Artistic License Price:
1026 downloads
Games::Blackjack 0.04
Games::Blackjack is a Perl module with Blackjack Utility Classes. more>>
Games::Blackjack is a Perl module with Blackjack Utility Classes.
SYNOPSIS
use Games::Blackjack;
# Create new shoe of cards
my $shoe = Games::Blackjack::Shoe->new(nof_decks => 4);
# Create two hands, player/dealer
my $player = Games::Blackjack::Hand->new(shoe => $shoe);
my $dealer = Games::Blackjack::Hand->new(shoe => $shoe);
# Two dealer cards
$dealer->draw();
print "Dealer: ", $dealer->as_string(), "n";
$dealer->draw(); # 2nd card not shown
$player->draw();
$player->draw();
print "Player: ", $player->as_string, "(",
$player->count_as_string, ")n";
# Lets assume player decides to stand. Dealers turn.
# Dealer plays Las Vegas rules
while(!$dealer->busted() and
$dealer->count("soft") < 17) {
$dealer->draw();
}
# Show winner (-1: Dealer, 1: Player, 1.5: Player Blackjack)
print "Player score: ", $player->score($dealer), "n";
<<lessSYNOPSIS
use Games::Blackjack;
# Create new shoe of cards
my $shoe = Games::Blackjack::Shoe->new(nof_decks => 4);
# Create two hands, player/dealer
my $player = Games::Blackjack::Hand->new(shoe => $shoe);
my $dealer = Games::Blackjack::Hand->new(shoe => $shoe);
# Two dealer cards
$dealer->draw();
print "Dealer: ", $dealer->as_string(), "n";
$dealer->draw(); # 2nd card not shown
$player->draw();
$player->draw();
print "Player: ", $player->as_string, "(",
$player->count_as_string, ")n";
# Lets assume player decides to stand. Dealers turn.
# Dealer plays Las Vegas rules
while(!$dealer->busted() and
$dealer->count("soft") < 17) {
$dealer->draw();
}
# Show winner (-1: Dealer, 1: Player, 1.5: Player Blackjack)
print "Player score: ", $player->score($dealer), "n";
Download (0.006MB)
Added: 2006-12-28 License: Perl Artistic License Price:
1035 downloads
Games::Euchre::Player 1.02
Games::Euchre::Player is a player class for Euchre card game. more>>
Games::Euchre::Player is a player class for Euchre card game.
The four Player objects are used to interact with the humand and computer players, as well as to keep the state of the players hand, whether he bid and whether he went alone.
CLASS METHODS
new GAME NUMBER NAME
Create and initialize a new Euchre player. The number is 1-4.
INSTANCE METHODS
getGame
Return the Euchre game instance to which this player belongs.
setTeam TEAM
Record the Team instance that this player belongs to.
getTeam
Return the Team instance to which this player belongs.
setAI AI
Record the AI instance for this player.
getAI
Return the AI instance for this player.
setAlone
Indicate that this player has chosen to go alone in the current hand.
setBid
Indicate that this player has chosen to choose trump in the current hand.
wentAlone
Returns a boolean indicating whether this player chose to go alone on a bid.
isBidder
Returns a boolean indicating whether this player called the trump suit during bidding.
getName
Return this players name
getNumber
Return this players number, between 1 and 4
getHand
Return the Games::Cards::Hand object representing this players current hand.
getCards
Return an array of the Games::Cards::Card objects held in the players hand.
resetGame
Clear all of the state for the current game and get ready for the next one.
resetHand
Clear all of the state for the current hand and get ready for the next one.
bid TURN
Allow the player to choose trump or pass. Returns one of: H, C, D, S, N, HA, CA, DA, SA, NA, or undef. If the player has an AI instance set, that is invoked. Otherwise a pathetically simple AI decides the bid.
pickItUp
Allow the player, as dealer, to select which card to trade for the turned up card. This method performs the actual trade. If the player has an AI instance set, that is invoked. Otherwise a pathetically simple AI chooses the card.
playCard TRICK
Allow the player to select which card to play on the current trick. This method performs the actual play. If the player has an AI instance set, that is invoked. Otherwise a pathetically simple AI chooses the card.
isLegalBid TURNNUMBER BID
Given a bid, return a boolean indicating the validity of that bid. The bid is tested for structure (one of H, C, D, S, N, HA, CA, DA, SA, NA, or undef), tested against the bidding round (only the turned-up card suit can be called in round 1 , and may not be called in round 2), against the game options (hang-the-dealer, no-trump).
This is called from the bid() method.
<<lessThe four Player objects are used to interact with the humand and computer players, as well as to keep the state of the players hand, whether he bid and whether he went alone.
CLASS METHODS
new GAME NUMBER NAME
Create and initialize a new Euchre player. The number is 1-4.
INSTANCE METHODS
getGame
Return the Euchre game instance to which this player belongs.
setTeam TEAM
Record the Team instance that this player belongs to.
getTeam
Return the Team instance to which this player belongs.
setAI AI
Record the AI instance for this player.
getAI
Return the AI instance for this player.
setAlone
Indicate that this player has chosen to go alone in the current hand.
setBid
Indicate that this player has chosen to choose trump in the current hand.
wentAlone
Returns a boolean indicating whether this player chose to go alone on a bid.
isBidder
Returns a boolean indicating whether this player called the trump suit during bidding.
getName
Return this players name
getNumber
Return this players number, between 1 and 4
getHand
Return the Games::Cards::Hand object representing this players current hand.
getCards
Return an array of the Games::Cards::Card objects held in the players hand.
resetGame
Clear all of the state for the current game and get ready for the next one.
resetHand
Clear all of the state for the current hand and get ready for the next one.
bid TURN
Allow the player to choose trump or pass. Returns one of: H, C, D, S, N, HA, CA, DA, SA, NA, or undef. If the player has an AI instance set, that is invoked. Otherwise a pathetically simple AI decides the bid.
pickItUp
Allow the player, as dealer, to select which card to trade for the turned up card. This method performs the actual trade. If the player has an AI instance set, that is invoked. Otherwise a pathetically simple AI chooses the card.
playCard TRICK
Allow the player to select which card to play on the current trick. This method performs the actual play. If the player has an AI instance set, that is invoked. Otherwise a pathetically simple AI chooses the card.
isLegalBid TURNNUMBER BID
Given a bid, return a boolean indicating the validity of that bid. The bid is tested for structure (one of H, C, D, S, N, HA, CA, DA, SA, NA, or undef), tested against the bidding round (only the turned-up card suit can be called in round 1 , and may not be called in round 2), against the game options (hang-the-dealer, no-trump).
This is called from the bid() method.
Download (0.021MB)
Added: 2006-12-21 License: Perl Artistic License Price:
1038 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 cards 1.45 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