Algorithm-MasterMind
view release on metacpan or search on metacpan
lib/Algorithm/MasterMind/Test.pm view on Meta::CPAN
package Algorithm::MasterMind::Test;
use warnings;
use strict;
use Carp;
use lib qw(../../lib);
our $VERSION = sprintf "%d.%03d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/g;
use base 'Algorithm::MasterMind';
sub initialize {
my $self = shift;
my $options = shift;
for my $o ( keys %$options ) {
$self->{"_$o"} = $options->{$o};
}
$self->{'_test'} = 1;
}
"some blacks, 0 white"; # Magic true value required at end of module
__END__
=head1 NAME
Algorithm::MasterMind::Test - Mock class used for testing algorithms
by hand
=head1 SYNOPSIS
use Algorithm::MasterMind::Test;
=head1 DESCRIPTION
Mainly used in test functions, and as a way of instantiating base
class.
=head1 INTERFACE
=head2 initialize()
Does nothing, really
=head2 new ( $options )
This function, and all the rest, are directly inherited from base
=head2 issue_first ()
Issues the first combination, which might be generated in a particular
way
=head2 issue_next()
Issues the next combination
=head2 feedback()
Obtain the result to the last combination played
=head2 guesses()
( run in 0.770 second using v1.01-cache-2.11-cpan-97f6503c9c8 )