Richard Clamp > Games-Set-0.01 > Games::Set

Download:
Games-Set-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Games::Set - 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 ) ? "set\n" : "no set\n";

DESCRIPTION ^

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

BUGS ^

None currently known. If you find any please make use of http://rt.cpan.org by mailing your report to bug-Games-Set@rt.cpan.org, or contact me directly.

AUTHOR ^

Richard Clamp <richardc@unixbeard.net>

Rules of Set by Set Enterprises. http://setgame.com/

COPYRIGHT ^

Copyright (C) 2003 Richard Clamp. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

http://setgame.com, purveyors of Set

http://set.omino.com David Van Brink's site detailling some of the maths involved

syntax highlighting: