Games::Cards::Bridge::Chicago - Object for Bridge (card game) Chicago scoring
Version 0.01
This module provides a class for creating Bridge objects for a Chicago game (aka 'Four-Deal Bridge'), including the results and scoring and current state of the game.
use Games::Cards::Bridge::Chicago; sub show_score { my $chi = shift; printf "NS = %d \t EW = %d\n", $chi->NS_score, $chi->EW_score; printf " Vul: NS = %d \t EW = %d\n", $chi->NS_vul, $chi->EW_vul; printf "==COMPLETE==\n" if $chi->complete; } my $chi = Games::Cards::Bridge::Chicago->new; show_score($chi); foreach my $opts ( { declarer => 'N', trump => 'H', bid => '4', made => '4' }, { declarer => 'S', trump => 'C', bid => '3', down => '2', dbl => 1 }, { declarer => 'E', trump => 'N', bid => '3', made => '3' }, { declarer => 'W', trump => 'D', bid => '5', down => '3' }, ){ $chi->contract( %$opts ); show_score($chi); }
No parameters needed.
Add a contract to the game. This needs the same arguments as Games::Cards::Bridge::Contract's constructor. This method is also responsible for internally updating the attributes. See also http://www.acbl.org/learn/scoreChicago.html
Alias to returns true iff ->we_vul() and ->they_vul().
These are all auto-calculated/maintained; their current values are available from the accessor method provided by Class::Accessor.
Array ref holding all the contracts added by the contract() method.
Gives the current total North-South score.
Gives the current total East-West score.
Returns true if the North-South side is vulnerable.
Returns true if the East-West side is vulnerable.
Returns true if the game has concluded (played 4 hands).
Returns N E S or W representing the current dealer.
Class::Accessor
Carp
Games::Cards::Bridge::Contract
David Westbrook, <dwestbrook at gmail.com>
<dwestbrook at gmail.com>
See Games::Cards::Bridge::Contract
Copyright 2006 David Westbrook, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Games::Cards::Bridge::Contract, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Cards::Bridge::Contract
CPAN shell
perl -MCPAN -e shell install Games::Cards::Bridge::Contract
For more information on module installation, please visit the detailed CPAN module installation guide.