Acme::Text::Rhombus - Draw a rhombus with letters/digits
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.......
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:
lines
Number of lines to be printed. Defaults to 25.
letter
Letter to start with. Defaults to a.
a
case
Lower/upper case of the letters within the rhombus. Defaults to upper.
upper
fillup
The fillup character. Defaults to '.'.
'.'
forward
Forward letter enumeration. Defaults to boolean 1.
1
Draws a rhombus with digits and returns it as a string.
digit
Digit to start with. Defaults to 0.
0
Forward digit enumeration. Defaults to boolean 1.
Draws a rhombus with random letters/digits and returns it as a string.
rhombus(), rhombus_letter(), rhombus_digit(), rhombus_random() are exportable.
rhombus(), rhombus_letter(), rhombus_digit(), rhombus_random()
:all - *()
Steven Schubiger <schubiger@cpan.org>
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
To install Acme::Text::Rhombus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::Text::Rhombus
CPAN shell
perl -MCPAN -e shell install Acme::Text::Rhombus
For more information on module installation, please visit the detailed CPAN module installation guide.