Acme-Text-Rhombus
view release on metacpan or search on metacpan
lib/Acme/Text/Rhombus.pm view on Meta::CPAN
1;
__END__
=head1 NAME
Acme::Text::Rhombus - Draw a rhombus with letters/digits
=head1 SYNOPSIS
use Acme::Text::Rhombus qw(rhombus);
print rhombus(
lines => 15,
letter => 'c',
case => 'upper',
fillup => '.',
forward => 1,
);
__OUTPUT__
.......C.......
......DDD......
.....EEEEE.....
....FFFFFFF....
...GGGGGGGGG...
..HHHHHHHHHHH..
.IIIIIIIIIIIII.
JJJJJJJJJJJJJJJ
.KKKKKKKKKKKKK.
..LLLLLLLLLLL..
...MMMMMMMMM...
....NNNNNNN....
.....OOOOO.....
......PPP......
.......Q.......
=head1 FUNCTIONS
=head2 rhombus, rhombus_letter
Draws a rhombus with letters and returns it as a string.
If no option value is supplied or if it is invalid, then a default
will be silently assumed (omitting all options will return a rhombus
of 25 lines).
Given that the specified number of lines is even, it will be
incremented to satisfy the requirement of being an odd number.
Options:
=over 4
=item * C<lines>
Number of lines to be printed. Defaults to 25.
=item * C<letter>
Letter to start with. Defaults to C<a>.
=item * C<case>
Lower/upper case of the letters within the rhombus. Defaults to C<upper>.
=item * C<fillup>
The fillup character. Defaults to C<'.'>.
=item * C<forward>
Forward letter enumeration. Defaults to boolean C<1>.
=back
=head2 rhombus_digit
Draws a rhombus with digits and returns it as a string.
If no option value is supplied or if it is invalid, then a default
will be silently assumed (omitting all options will return a rhombus
of 25 lines).
Given that the specified number of lines is even, it will be
incremented to satisfy the requirement of being an odd number.
Options:
=over 4
=item * C<lines>
Number of lines to be printed. Defaults to 25.
=item * C<digit>
Digit to start with. Defaults to C<0>.
=item * C<fillup>
The fillup character. Defaults to C<'.'>.
=item * C<forward>
Forward digit enumeration. Defaults to boolean C<1>.
=back
=head2 rhombus_random
Draws a rhombus with random letters/digits and returns it as a string.
If no option value is supplied or if it is invalid, then a default
will be silently assumed (omitting all options will return a rhombus
of 25 lines).
Given that the specified number of lines is even, it will be
incremented to satisfy the requirement of being an odd number.
Options:
=over 4
=item * C<lines>
Number of lines to be printed. Defaults to 25.
=item * C<fillup>
The fillup character. Defaults to C<'.'>.
=back
=head1 EXPORT
=head2 Functions
C<rhombus(), rhombus_letter(), rhombus_digit(), rhombus_random()> are exportable.
=head2 Tags
C<:all - *()>
=head1 AUTHOR
Steven Schubiger <schubiger@cpan.org>
=head1 LICENSE
This program is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.
See L<http://dev.perl.org/licenses/>
=cut
( run in 1.108 second using v1.01-cache-2.11-cpan-39bf76dae61 )