Commits

Shlomi Fish committed 6bd8958

Tagging the Task-FreecellSolver-Testing trunk as release 0.0.1

git-svn-id: file:///home/shlomif/Backup/svn-dumps/google-code/svnsync-repos/fc-solve/tags/Task-FreecellSolver-Testing@2175 e7e8a897-7ba4-4ee7-b36f-f4c66519b19a

  • Participants
  • Parent commits f070260
  • Tags Task-FreecellSolver-Testing@3681

Comments (0)

Files changed (625)

releases/0.0.1/CVSROOT/checkoutlist

+# The "checkoutlist" file is used to support additional version controlled
+# administrative files in $CVSROOT/CVSROOT, such as template files.
+#
+# The first entry on a line is a filename which will be checked out from
+# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
+# The remainder of the line is an error message to use if the file cannot
+# be checked out.
+#
+# File format:
+#
+#	[<whitespace>]<filename><whitespace><error message><end-of-line>
+#
+# comment lines begin with '#'

releases/0.0.1/CVSROOT/commitinfo

+# The "commitinfo" file is used to control pre-commit checks.
+# The filter on the right is invoked with the repository and a list 
+# of files to check.  A non-zero exit of the filter program will 
+# cause the commit to be aborted.
+#
+# The first entry on a line is a regular expression which is tested
+# against the directory that the change is being committed to, relative
+# to the $CVSROOT.  For the first match that is found, then the remainder
+# of the line is the name of the filter to run.
+#
+# If the repository name does not match any of the regular expressions in this
+# file, the "DEFAULT" line is used, if it is specified.
+#
+# If the name "ALL" appears as a regular expression it is always used
+# in addition to the first matching regex or "DEFAULT".

releases/0.0.1/CVSROOT/config

+# Set this to "no" if pserver shouldn't check system users/passwords
+#SystemAuth=no
+
+# Set `PreservePermissions' to `yes' to save file status information
+# in the repository.
+#PreservePermissions=no
+
+# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
+# level of the new working directory when using the `cvs checkout'
+# command.
+#TopLevelAdmin=no

releases/0.0.1/CVSROOT/cvswrappers

+# This file affects handling of files based on their names.
+#
+# The -t/-f options allow one to treat directories of files
+# as a single file, or to transform a file in other ways on
+# its way in and out of CVS.
+#
+# The -m option specifies whether CVS attempts to merge files.
+#
+# The -k option specifies keyword expansion (e.g. -kb for binary).
+#
+# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
+#
+#  wildcard	[option value][option value]...
+#
+#  where option is one of
+#  -f		from cvs filter		value: path to filter
+#  -t		to cvs filter		value: path to filter
+#  -m		update methodology	value: MERGE or COPY
+#  -k		expansion mode		value: b, o, kkv, &c
+#
+#  and value is a single-quote delimited value.
+# For example:
+#*.gif -k 'b'

releases/0.0.1/CVSROOT/editinfo

+# The "editinfo" file is used to allow verification of logging
+# information.  It works best when a template (as specified in the
+# rcsinfo file) is provided for the logging procedure.  Given a
+# template with locations for, a bug-id number, a list of people who
+# reviewed the code before it can be checked in, and an external
+# process to catalog the differences that were code reviewed, the
+# following test can be applied to the code:
+#
+#   Making sure that the entered bug-id number is correct.
+#   Validating that the code that was reviewed is indeed the code being
+#       checked in (using the bug-id number or a seperate review
+#       number to identify this particular code set.).
+#
+# If any of the above test failed, then the commit would be aborted.
+#
+# Actions such as mailing a copy of the report to each reviewer are
+# better handled by an entry in the loginfo file.
+#
+# One thing that should be noted is the the ALL keyword is not
+# supported.  There can be only one entry that matches a given
+# repository.

releases/0.0.1/CVSROOT/loginfo

+# The "loginfo" file controls where "cvs commit" log information
+# is sent.  The first entry on a line is a regular expression which must match
+# the directory that the change is being made to, relative to the
+# $CVSROOT.  If a match is found, then the remainder of the line is a filter
+# program that should expect log information on its standard input.
+#
+# If the repository name does not match any of the regular expressions in this
+# file, the "DEFAULT" line is used, if it is specified.
+#
+# If the name ALL appears as a regular expression it is always used
+# in addition to the first matching regex or DEFAULT.
+#
+# You may specify a format string as part of the
+# filter.  The string is composed of a `%' followed
+# by a single format character, or followed by a set of format
+# characters surrounded by `{' and `}' as separators.  The format
+# characters are:
+#
+#   s = file name
+#   V = old version number (pre-checkin)
+#   v = new version number (post-checkin)
+#
+# For example:
+#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
+# or
+#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog

releases/0.0.1/CVSROOT/modules

+# Three different line formats are valid:
+#	key	-a    aliases...
+#	key [options] directory
+#	key [options] directory files...
+#
+# Where "options" are composed of:
+#	-i prog		Run "prog" on "cvs commit" from top-level of module.
+#	-o prog		Run "prog" on "cvs checkout" of module.
+#	-e prog		Run "prog" on "cvs export" of module.
+#	-t prog		Run "prog" on "cvs rtag" of module.
+#	-u prog		Run "prog" on "cvs update" of module.
+#	-d dir		Place module in directory "dir" instead of module name.
+#	-l		Top-level directory only -- do not recurse.
+#
+# NOTE:  If you change any of the "Run" options above, you'll have to
+# release and re-checkout any working directories of these modules.
+#
+# And "directory" is a path to a directory relative to $CVSROOT.
+#
+# The "-a" option specifies an alias.  An alias is interpreted as if
+# everything on the right of the "-a" had been typed on the command line.
+#
+# You can encode a module within a module by using the special '&'
+# character to interpose another module into the current module.  This
+# can be useful for creating a module that consists of many directories
+# spread out over the entire source repository.

releases/0.0.1/CVSROOT/notify

+# The "notify" file controls where notifications from watches set by
+# "cvs watch add" or "cvs edit" are sent.  The first entry on a line is
+# a regular expression which is tested against the directory that the
+# change is being made to, relative to the $CVSROOT.  If it matches,
+# then the remainder of the line is a filter program that should contain
+# one occurrence of %s for the user to notify, and information on its
+# standard input.
+#
+# "ALL" or "DEFAULT" can be used in place of the regular expression.
+#
+# For example:
+#ALL mail %s -s "CVS notification"

releases/0.0.1/CVSROOT/rcsinfo

+# The "rcsinfo" file is used to control templates with which the editor
+# is invoked on commit and import.
+#
+# The first entry on a line is a regular expression which is tested
+# against the directory that the change is being made to, relative to the
+# $CVSROOT.  For the first match that is found, then the remainder of the
+# line is the name of the file that contains the template.
+#
+# If the repository name does not match any of the regular expressions in this
+# file, the "DEFAULT" line is used, if it is specified.
+#
+# If the name "ALL" appears as a regular expression it is always used
+# in addition to the first matching regex or "DEFAULT".

releases/0.0.1/CVSROOT/taginfo

+# The "taginfo" file is used to control pre-tag checks.
+# The filter on the right is invoked with the following arguments:
+#
+# $1 -- tagname
+# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
+# $3 -- repository
+# $4->  file revision [file revision ...]
+#
+# A non-zero exit of the filter program will cause the tag to be aborted.
+#
+# The first entry on a line is a regular expression which is tested
+# against the directory that the change is being committed to, relative
+# to the $CVSROOT.  For the first match that is found, then the remainder
+# of the line is the name of the filter to run.
+#
+# If the repository name does not match any of the regular expressions in this
+# file, the "DEFAULT" line is used, if it is specified.
+#
+# If the name "ALL" appears as a regular expression it is always used
+# in addition to the first matching regex or "DEFAULT".

releases/0.0.1/CVSROOT/verifymsg

+# The "verifymsg" file is used to allow verification of logging
+# information.  It works best when a template (as specified in the
+# rcsinfo file) is provided for the logging procedure.  Given a
+# template with locations for, a bug-id number, a list of people who
+# reviewed the code before it can be checked in, and an external
+# process to catalog the differences that were code reviewed, the
+# following test can be applied to the code:
+#
+#   Making sure that the entered bug-id number is correct.
+#   Validating that the code that was reviewed is indeed the code being
+#       checked in (using the bug-id number or a seperate review
+#       number to identify this particular code set.).
+#
+# If any of the above test failed, then the commit would be aborted.
+#
+# Actions such as mailing a copy of the report to each reviewer are
+# better handled by an entry in the loginfo file.
+#
+# One thing that should be noted is the the ALL keyword is not
+# supported.  There can be only one entry that matches a given
+# repository.

releases/0.0.1/Games-Solitaire-Verify/Games-Solitaire-Verify/Build.PL

+use strict;
+use warnings;
+
+use File::Spec;
+use lib File::Spec->catdir(File::Spec->curdir(), "inc");
+
+use Test::Run::Builder;
+
+my $builder = Test::Run::Builder->new(
+    module_name         => 'Games::Solitaire::Verify',
+    license             => 'mit',
+    dist_author         => 'Shlomi Fish <shlomif@iglu.org.il>',
+    dist_version_from   => 'lib/Games/Solitaire/Verify.pm',
+    build_requires => {
+        'Test::More' => 0,
+    },
+    requires => {
+        'base' => 0,
+        'Class::Accessor' => 0,
+        'File::Spec' => 0,
+        'Exception::Class' => 0,
+        'List::Util' => 0,
+    },
+    add_to_cleanup      => [ 'Games-Solitaire-Verify-*' ],
+    create_makefile_pl => 'traditional',
+    script_files => [],
+    meta_merge =>
+    {
+        resources =>
+        {
+            repository => "http://svn.berlios.de/svnroot/repos/fc-solve/trunk/Games-Solitaire-Verify/",
+            homepage => "http://fc-solve.berlios.de/verify-code/",
+            MailingList => "http://tech.groups.yahoo.com/group/fc-solve-discuss/",
+        },
+        keywords =>
+        [
+            "baker's dozen",
+            "baker's game",
+            "card",
+            "card games",
+            "cards",
+            "eight off",
+            "forecell",
+            "foundations",
+            "freecell",
+            "french",
+            "games",
+            "moves",
+            "patience",
+            "seahaven",
+            "seahaven towers",
+            "simple simon",
+            "single-player",
+            "solitaire",
+            "solutions",
+            "solve",
+            "solving",
+            "verification",
+            "verify",
+        ],
+    },
+
+);
+
+$builder->create_build_script();

releases/0.0.1/Games-Solitaire-Verify/Games-Solitaire-Verify/COPYING

+Copyright (c) 2008 Shlomi Fish
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+----------------------------------------------------------------------------
+
+This is the MIT/X11 Licence. For more information see:
+
+1. http://www.opensource.org/licenses/mit-license.php
+
+2. http://en.wikipedia.org/wiki/MIT_License

releases/0.0.1/Games-Solitaire-Verify/Games-Solitaire-Verify/Changes

+Revision history for Games-Solitaire-Verify
+
+0.08    Sat Jul  4 11:24:29 IDT 2009
+        - Removed the "all rights reserved" language. I was told it is
+        incompatible with the MIT/X11 License.
+        - Added the COPYING file.
+
+0.07    Mon Jun 22 23:37:01 IDT 2009
+        - Added some meta-data (repository, homepage, mailing list and 
+        keywords) to META.yml.
+        - Implemented many missing exceptions.
+            - Added tests for some of them.
+
+0.06    Sat May 30 15:56:13 IDT 2009
+        - Now the module can verify Simple Simon moves and solutions. 
+            - The support has many loose ends including many non-existent 
+            exceptions, but it should still yield a true verdict 
+            if-and-only-if the solution is correct.
+
+0.05    Sat Jan 24 21:33:30 IST 2009
+        - Made sure that when unlimited sequence move takes place, it isn't
+        affected by kings_only, etc. I.e: it always allows to move an
+        arbitrary number of cards when it is specified.
+            - Bug discovered based on this post by larrysan:
+            - http://tech.groups.yahoo.com/group/fc-solve-discuss/message/856
+
+0.04    Thu Aug  7 20:36:14 IDT 2008
+        - Now verify_and_perform_move in Games::Solitaire::Verify::State
+        is returning objects of exception classes, instead of stringified
+        errors, to facilitate knowing exactly why the move is invalid.
+        - Refactored Games::Solitaire::Verify::State:
+            - Extracted methods from verify_and_perform_move
+            - Converted to a ->can() dispatch table.
+
+0.03    Fri Jul 25 13:39:35 IDT 2008
+        - Added support for more variants of Solitaire, using the
+        Freecell Solver-style parameterization:
+            - num_freecells
+            - num_columns
+            - num_decks
+            - sequence_move
+            - seq_build_by
+            - empty_stacks_filled_by
+        - Added more support modules:
+            - lib/Games/Solitaire/Verify/VariantParams.pm
+            - lib/Games/Solitaire/Verify/VariantsMap.pm
+        - 
+0.02    Thu Jul 10 15:05:10 IDT 2008
+        - Added another test for a wrong solution.
+        - Extracted two classes from Games::Solitaire::Verify::State :
+            - lib/Games/Solitaire/Verify/Foundations.pm
+            - lib/Games/Solitaire/Verify/Freecells.pm
+        - Added List::Util to the "requires" - it was missing.
+
+0.0102  Thu Jul 10 03:06:18 IDT 2008
+        - Fixed the script with the absolute path on Makefile.PL
+        - Moved bin to script because it's written in pure-Perl.
+
+0.0101  Wed Jul  9 16:30:27 IDT 2008
+        - Fixed various bugs:
+            - incompatible output between what we had and Freecell Solver
+            (trailing whitespace etc.)
+            - Added a test assertion for verifying that a wrong solution is
+              wrong. (which uncovered the bugs.)
+            - Fixed the solution verification logic.
+
+0.01    Sat Jul  5 19:59:36 IDT 2008
+        - First version.
+        - Can only do Freecell for now, but there's a lot of modularity
+        and extensibility infrastrucutre in place.
+        - 193 Test Assertions.

releases/0.0.1/Games-Solitaire-Verify/Games-Solitaire-Verify/MANIFEST

+Build.PL
+Changes
+COPYING
+inc/Test/Run/Builder.pm
+lib/Games/Solitaire/Verify/Base.pm
+lib/Games/Solitaire/Verify/Card.pm
+lib/Games/Solitaire/Verify/Column.pm
+lib/Games/Solitaire/Verify/Exception.pm
+lib/Games/Solitaire/Verify/Foundations.pm
+lib/Games/Solitaire/Verify/Freecells.pm
+lib/Games/Solitaire/Verify/Move.pm
+lib/Games/Solitaire/Verify.pm
+lib/Games/Solitaire/Verify/Solution.pm
+lib/Games/Solitaire/Verify/State.pm
+lib/Games/Solitaire/Verify/VariantParams.pm
+lib/Games/Solitaire/Verify/VariantsMap.pm
+Makefile.PL
+MANIFEST
+META.yml
+README
+script/verify-solution
+t/00-load.t
+t/01-base.t
+t/02-move.t
+t/03-card.t
+t/04-column.t
+t/05-state.t
+t/06-verify-moves.t
+t/07-solution.t
+t/data/sample-solutions/fcs-bakers-game-24.txt
+t/data/sample-solutions/fcs-eight-off-200-l-gi.txt
+t/data/sample-solutions/fcs-eight-off-200.txt
+t/data/sample-solutions/fcs-forecell-24.txt
+t/data/sample-solutions/fcs-freecell-24.txt
+t/data/sample-solutions/fcs-freecell-24-wrong-1.txt
+t/data/sample-solutions/fcs-freecell-24-wrong-2.txt
+t/data/sample-solutions/fcs-larrysan-kings-only-0-freecells-unlimited-move.txt
+t/data/sample-solutions/fcs-relaxed-freecell-11982.txt
+t/data/sample-solutions/fcs-seahaven-towers-1977.txt
+t/data/sample-solutions/fcs-simple-simon-24.txt
+t/pod-coverage.t
+t/pod.t

releases/0.0.1/Games-Solitaire-Verify/Games-Solitaire-Verify/README

+Games-Solitaire-Verify
+
+This is a CPAN Perl module that verifies the solutions of various variants
+of card Solitaire. It does not aim to try to be a solver for them, because
+this is too CPU intensive to be adequately done using perl5 (as of 
+perl-5.10.0). If you're interested in the latter, look at:
+
+* http://fc-solve.berlios.de/
+
+* http://fc-solve.berlios.de/links.html#other_solvers
+
+Instead, what Games-Solitaire-Verify does is verify the solutions
+and makes sure they are correct.
+
+See http://pysolfc.sourceforge.net/ for more about card solitaire.
+
+INSTALLATION
+
+To install this module, run the following commands:
+
+	perl Build.PL
+	./Build
+	./Build test
+	./Build install
+
+Alternatively you can use CPAN.pm or CPANPLUS.pm, or more preferably your
+operating system's wrappers for them.
+
+SUPPORT AND DOCUMENTATION
+
+After installing, you can find documentation for this module with the
+perldoc command.
+
+    perldoc Games::Solitaire::Verify
+
+You can also look for information at:
+
+    RT, CPAN's request tracker
+        http://rt.cpan.org/NoAuth/Bugs.html?Dist=Games-Solitaire-Verify
+
+    AnnoCPAN, Annotated CPAN documentation
+        http://annocpan.org/dist/Games-Solitaire-Verify
+
+    CPAN Ratings
+        http://cpanratings.perl.org/d/Games-Solitaire-Verify
+
+    Search CPAN
+        http://search.cpan.org/dist/Games-Solitaire-Verify
+
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2008 Shlomi Fish
+
+This program is released under the following license: MIT X11 License.
+

releases/0.0.1/Games-Solitaire-Verify/Games-Solitaire-Verify/build-ctags.sh

+#!/bin/sh
+ctags -f tags --recurse --totals \
+    --exclude='**/blib/**' --exclude='blib/**' --exclude='**/t/lib/**' \
+    --exclude='**/.svn/**' --exclude='*~' \
+    --exclude='Games-Solitaire-Verify-*/**' \
+    --languages=Perl --langmap=Perl:+.t

releases/0.0.1/Games-Solitaire-Verify/Games-Solitaire-Verify/bump-version-number.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use File::Find::Object;
+use IO::All;
+
+my $tree = File::Find::Object->new({}, 'lib/Games/Solitaire/');
+
+while (my $r = $tree->next()) {
+    if ($r =~ m{/\.svn\z})
+    {
+        $tree->prune();
+    }
+    elsif ($r =~ m{\.pm\z})
+    {
+        my @lines = io->file($r)->getlines();
+        LINES_LOOP:
+        foreach (@lines)
+        {
+            if (s#(\$VERSION = ')\d+\.\d+(')#$1 . "0.08" . $2#e)
+            {
+                last LINES_LOOP;
+            }
+        }
+        io->file($r)->print(
+            @lines
+        );
+    }
+}
+

releases/0.0.1/Games-Solitaire-Verify/Games-Solitaire-Verify/inc/Test/Run/Builder.pm

+package Test::Run::Builder;
+
+use strict;
+use warnings;
+
+use Module::Build;
+
+use vars qw(@ISA);
+
+@ISA = (qw(Module::Build));
+
+sub ACTION_runtest
+{
+    my ($self) = @_;
+    my $p = $self->{properties};
+
+    $self->depends_on('code');
+
+    local @INC = @INC;
+
+    # Make sure we test the module in blib/
+    unshift @INC, (File::Spec->catdir($p->{base_dir}, $self->blib, 'lib'),
+		 File::Spec->catdir($p->{base_dir}, $self->blib, 'arch'));
+
+    $self->do_test_run_tests;
+}
+
+sub ACTION_distruntest {
+  my ($self) = @_;
+
+  $self->depends_on('distdir');
+
+  my $start_dir = $self->cwd;
+  my $dist_dir = $self->dist_dir;
+  chdir $dist_dir or die "Cannot chdir to $dist_dir: $!";
+  # XXX could be different names for scripts
+
+  $self->run_perl_script('Build.PL') # XXX Should this be run w/ --nouse-rcfile
+      or die "Error executing 'Build.PL' in dist directory: $!";
+  $self->run_perl_script('Build')
+      or die "Error executing 'Build' in dist directory: $!";
+  $self->run_perl_script('Build', [], ['runtest'])
+      or die "Error executing 'Build test' in dist directory";
+  chdir $start_dir;
+}
+
+sub do_test_run_tests
+{
+    my $self = shift;
+
+    require Test::Run::CmdLine::Iface;
+
+    my $test_run =
+        Test::Run::CmdLine::Iface->new(
+            {
+                'test_files' => [glob("t/*.t")],
+            }   
+            # 'backend_params' => $self->_get_backend_params(),
+        );
+
+    return $test_run->run();
+}
+
+1;
+

releases/0.0.1/Games-Solitaire-Verify/Games-Solitaire-Verify/lib/Games/Solitaire/Verify.pm

+package Games::Solitaire::Verify;
+
+use warnings;
+use strict;
+
+=head1 NAME
+
+Games::Solitaire::Verify - verify solutions for solitaire games.
+
+=head1 VERSION
+
+Version 0.02
+
+=cut
+
+our $VERSION = '0.08';
+
+=head1 SYNOPSIS
+
+    use Games::Solitaire::Verify::Solution;
+
+    my $verifier = Games::Solitaire::Verify::Solution->new();
+
+    $verifier->verify_solution({ fh => \*STDIN });
+
+=head1 DESCRIPTION
+
+This is a CPAN Perl module that verifies the solutions of various variants
+of card Solitaire. It does not aim to try to be a solver for them, because
+this is too CPU intensive to be adequately done using perl5 (as of 
+perl-5.10.0). If you're interested in the latter, look at:
+
+=over 4
+
+=item * http://fc-solve.berlios.de/
+
+=item * http://fc-solve.berlios.de/links.html#other_solvers
+
+=back
+
+Instead, what Games-Solitaire-Verify does is verify the solutions
+and makes sure they are correct.
+
+See L<http://pysolfc.sourceforge.net/> for more about card solitaire.
+
+=head1 SEE ALSO
+
+L<Games::Solitaire::Verify::Solution> , L<Games::Solitaire::Verify::State>
+
+=head1 AUTHOR
+
+Shlomi Fish, C<< <shlomif at iglu.org.il> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to C<bug-games-solitaire-verifysolution at rt.cpan.org>, or through
+the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Games-Solitaire-Verify>.  I will be notified, and then you'll
+automatically be notified of progress on your bug as I make changes.
+
+
+
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+    perldoc Games::Solitaire::Verify
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Games-Solitaire-Verify>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Games-Solitaire-Verify>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Games-Solitaire-Verify>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Games-Solitaire-Verify>
+
+=back
+
+
+=head1 ACKNOWLEDGEMENTS
+
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2008 Shlomi Fish.
+
+This program is released under the following license: MIT/X11
+( L<http://www.opensource.org/licenses/mit-license.php> ).
+
+=cut
+
+1; # End of Games::Solitaire::Verify

releases/0.0.1/Games-Solitaire-Verify/Games-Solitaire-Verify/lib/Games/Solitaire/Verify/Base.pm

+package Games::Solitaire::Verify::Base;
+
+use strict;
+use warnings;
+
+=head1 NAME
+
+Games::Solitaire::Verify::Base - a base class.
+
+=cut
+
+use vars qw($VERSION);
+
+$VERSION = '0.08';
+
+use base 'Class::Accessor';
+
+=head1 SYNOPSIS
+
+    use base 'Games::Solitaire::Verify::Base';
+
+    sub _init
+    {
+        my ($self, $args) = @_;
+
+        $self->address($args->{address});
+
+        if (!exists($args->{name}))
+        {
+            die "No name - no cry.";
+        }
+
+        return;
+    }
+
+=head1 DESCRIPTION
+
+This is the base class for L<Games::Solitaire::Verify> classes.
+Everything is subject to change.
+
+=cut
+
+=head1 FUNCTIONS
+
+=head2 new($args)
+
+The constructor. Blesses and calls _init() .
+
+=cut
+
+sub new
+{
+    my $class = shift;
+    my $self = {};
+    bless $self, $class;
+
+    # May throw an exception.
+    $self->_init(@_);
+
+    return $self;
+}
+
+=head1 AUTHOR
+
+Shlomi Fish, C<< <shlomif at iglu.org.il> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to C<bug-games-solitaire-verifysolution-move at rt.cpan.org>, or through
+the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Games-Solitaire-Verify>.  I will be notified, and then you'll
+automatically be notified of progress on your bug as I make changes.
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+    perldoc Games::Solitaire::Verify
+
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Games-Solitaire-Verify>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Games-Solitaire-Verify>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Games-Solitaire-Verify>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Games-Solitaire-Verify>
+
+=back
+
+
+=head1 ACKNOWLEDGEMENTS
+
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2008 Shlomi Fish.
+
+This program is released under the following license: MIT/X11
+( L<http://www.opensource.org/licenses/mit-license.php> ).
+
+=cut
+
+1; # End of Games::Solitaire::Verify::Move

releases/0.0.1/Games-Solitaire-Verify/Games-Solitaire-Verify/lib/Games/Solitaire/Verify/Card.pm

+package Games::Solitaire::Verify::Card;
+
+use warnings;
+use strict;
+
+=head1 NAME
+
+Games::Solitaire::Verify::Card - a class wrapper for an individual 
+Solitaire card.
+
+=head1 VERSION
+
+Version 0.0101
+
+=cut
+
+our $VERSION = '0.08';
+
+use base 'Games::Solitaire::Verify::Base';
+
+use Games::Solitaire::Verify::Exception;
+
+__PACKAGE__->mk_accessors(qw(
+    rank
+    suit
+    _game
+    ));
+
+=head1 SYNOPSIS
+
+    use Games::Solitaire::Verify::Card;
+
+    # Initialise a Queen-of-Hearts
+    my $queen_of_hearts = Games::Solitaire::Verify::Card->new(
+        {
+            string => "QH",
+        },
+    );
+
+=head1 FUNCTIONS
+
+=cut
+
+sub _card_num_normalize
+{
+    my $arg = shift;
+
+    if (ref($arg) eq "")
+    {
+        return +{ map { $_ => $arg } (qw(t non_t)) };
+    }
+    else
+    {
+        return $arg
+    }
+}
+
+my @card_nums =  (map { _card_num_normalize($_) } 
+    ("A", (2 .. 9), 
+    {
+        't' => "T",
+        'non_t' => "10",
+    },
+    , "J", "Q", "K"));
+
+my %ranks_map = (map { $card_nums[$_]->{t} => ($_+1) } (0 .. $#card_nums));
+
+my @suits_map_proto =
+(
+    ["H" => { name => "hearts",   color => "red", },],
+    ["C" => { name => "clubs",    color => "black", },],
+    ["D" => { name => "diamonds", color => "red", },],
+    ["S" => { name => "spades",   color => "black", },],
+);
+
+my %suits_map = (map {@$_} @suits_map_proto);
+
+=head2 $class->get_suits_seq()
+
+Returns the expected sequence of the suits - "H", "S", "C", "D".
+
+=cut
+
+sub get_suits_seq
+{
+    my $class = shift;
+
+    return [map { $_->[0] } @suits_map_proto];
+}
+
+=head2 $class->calc_rank($rank_string)
+
+Calculates the numerical rank of the string passed as argument.
+
+Example:
+
+    my $ten = Games::Solitaire::Verify::Card->calc_rank("T")
+    # Prints 10.
+    print "$ten\n";
+
+=cut
+
+sub calc_rank
+{
+    my ($self, $s) = @_;
+
+    return $ranks_map{$s};
+}
+