Games::Blackjack

Games::Blackjack is a Perl module with Blackjack Utility Classes.
Download

Games::Blackjack Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Mike Schilli
  • Publisher web site:
  • http://search.cpan.org/~mschilli/X10-Home-0.03/Home.pm

Games::Blackjack Tags


Games::Blackjack Description

Games::Blackjack is a Perl module with Blackjack Utility Classes. 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"; # Let's assume player decides to stand. Dealer's 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"; Requirements: · Perl


Games::Blackjack Related Software