App-ForKids-LogicalPuzzleGenerator

 view release on metacpan or  search on metacpan

lib/App/ForKids/LogicalPuzzleGenerator/Variable/Name.pm  view on Meta::CPAN

package App::ForKids::LogicalPuzzleGenerator::Variable::Name;

use strict;
use warnings FATAL => 'all';
use Carp;
use base 'App::ForKids::LogicalPuzzleGenerator::Variable';


=head1 NAME

App::ForKids::LogicalPuzzleGenerator::Variable::Name

=head1 VERSION

Version 0.01

=cut

our $VERSION = '0.01';


=head1 SYNOPSIS

The module is used by the App::ForKids::LogicalPuzzleGenerator.

    use App::ForKids::LogicalPuzzleGenerator;

=cut

our @names =
(
	"Patrick",
	"Stephen",
	"Leonard",
	"William",
	"James",
	"John"
);

=head1 SUBROUTINES/METHODS

=head2 new

=cut

sub new
{
	my $class = shift;
	my $this = $class->SUPER::new(@_);

	# select the names
	for my $i (0..$$this{amount_of_values}-1)
	{
		while (1)
		{
			my $value = $names[int(rand()*@names)];
			if (!grep {$_ eq $value } @{$$this{selected_values}})
			{
				push @{$$this{selected_values}}, $value;
				last;
			}
		}
	}
	return $this;
}


=head1 AUTHOR

Pawel Biernacki, C<< <pawel.f.biernacki at gmail> >>

=head1 BUGS

Please report any bugs or feature requests to C<bug-app-forkids-logicalpuzzlegenerator at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-ForKids-LogicalPuzzleGenerator>.  I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.


=cut

1;



( run in 0.730 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )