Games::Set module contains the rules for the game of set.
SYNOPSIS
my $game = Games::Set->new({ deck => [ Games::Set->standard_deck ] });
$game->shuffle;
my @cards = map { $game->deal } 1..3; # give me 3 cards
print $game->set( @cards ) ? "setn" : "no setn";
Games::Set understands some of the rules of the card game Set. It also knows how to generate a standard deck.
METHODS
new
Class::Accessor inherited constructor, returns a new gamestate
deck
The current deck. A reference to an array containing many Games::Set::Card objects.
shuffle
Shuffle the current deck.
deal
Take a card from the top of the deck.
standard_deck
Calculates the standard deck as a list of Games::Set::Card objects.
set( @cards )
Returns true if the cards make a set.
find_sets( @cards )
returns all the possible sets within @cards as array references
Product's homepage
Requirements:
· Perl