Acme-Zalgo
view release on metacpan or search on metacpan
lib/Acme/Zalgo.pm view on Meta::CPAN
if (not defined $max) {
$max = $min;
$min = 0;
}
return int(rand($max - $min)) + $min;
}
sub rand_char {
my ($s) = @_;
return substr($s, randint(length $s), 1);
}
sub zalgo_char {
my ($c, $upmin, $upmax, $midmin, $midmax, $downmin, $downmax) = @_;
for my $i (1..randint($upmin, $upmax)) {
$c .= rand_char($ZALGO[0]);
}
for my $i (1..randint($midmin, $midmax)) {
$c .= rand_char($ZALGO[1]);
}
for my $i (1..randint($downmin, $downmax)) {
$c .= rand_char($ZALGO[2]);
}
return $c;
}
sub zalgo {
if (not @_) {
@_ = ("HE COMES");
}
if (@_ == 1) {
push @_, (0,5, 0,5, 0,5);
} elsif (@_ == 2) {
my ($s, $max) = @_;
@_ = ($s, 0, $max, 0, $max, 0, $max);
}
my ($str, $minup, $maxup, $minmid, $maxmid, $mindown, $maxdown) = @_;
$str =~ s/$ZALGO_REGEX/zalgo_char($1,$minup,$maxup+1,$minmid,$maxmid+1,$mindown,$maxdown+1)/ge;
return $str;
}
package
COMES; # hide from cpan
sub HE {
my $pkg = shift;
Acme::Zalgo::zalgo(@_);
}
1;
__END__
=head1 NAME
Acme::Zalgo - The Nezperdian hive-mind of chaos.
=head1 SYNOPSIS
use Acme::Zalgo;
binmode STDOUT, ':utf8';
print zalgo("Hello world\n");
# alternate syntax. NO COMMAS, THEY ARE FORBIDDEN
print HE COMES "Tony The Pony\n";
=head1 DESCRIPTION
TÍÌ̺oÌ©ÌÌÍ¡ Í̯Ìi̤ÌÍn̮̹ÍÍvÌ̬̬ÌÌÍ̲̺o̳̪ÌÌ»Í̺Í
kÍ̪ÌÌÍÍeÒÌ̹ÌÌÍ
̪Ì̥̯ÍthÌÌ©Ì Ì̱eḬ̀Í̤ÍÍÍ
Í̩̰ÍÌÌÌ®hÌ´Ì¥iÒÍÍÍÌ®vÌÌ£ÌÌÌẹÍ-̱ÍÍmÍi̲̪ÌÍn̩̲̳Ì̮̯ÍdÌÌ«Ì̦Ì̯ÌÌ Ò̹Ḭ́ÍÍ̲̻...
ÌÍÍÍÌIÅ̰̯̬̤̹vÌ¼Ì¬Ì Í
oÌ ÌkÌ¦Ì ÍÌiÍÍÍá¹Ì¯ÍgÌÌ¥ ̣̹ÌÌÍ̬t̲Ì̫̪heÌÍ̮̲ ÍÌÍ̱ÌÍ
fÒÍÍÍ̱̦̰e̺Ì̯̩̩e̸l̸ÍÍiÌ¼Ì Ì²ÍÍÍÍÅ̻̻ÌÍ̳ÌÍgÌ̼̹ÍÍ Ì¨Ì©o̰̤̻fÌ»Ì̯Í̪ÍÍ Ì¦Ì±Ì±ÍcÒÌÌÍ̮̰Ì̦h̸̬ÍÌ...
Ì«ÌÌ̬̪̣Í
WÌÌ®Í̼̼iÍÌÌÍ̩̤tÌÌ©ÌÌ¥ÌhÌÌ»ÌÌ ÌÌ®ÍouÌÍÌÍ¡t ̲oÌ´Ì Ị̮̀Í̱ÌrÌÌdÌ·Ḭ́ÍÌÌ£eÍÍÍÌ̲ÌÍ
rÌ̥̪̪ÌÍ .ÍÌ̲̺̻ÍÍÍ
Ì̥ŢÌÍÌÌheÒ á¹Ì¶ÍÌ̼á¸Ì´Ì¥Í̳̲z̤ÌÍ
pÍ̩̱eÍÍrÌÌ̪ÍdÒÍ̹ÍÍ̪̱i̹̹̻̣aÍÍ¢n̼ÌÍ ÌÍḫ̨ÌÍ̹Í̺ÍiÍÌÍ̬Ìv̩̫̻Ì̤̺Íè̥̯̯Ì-̯ÍÍÍmÌ®ÍÍi̲nÍ̤ÍḬ́ÍdÌÍÌÌÍ Ì²Ío̵ÍÍ̱̤f̲ÍÌªÌ Ì¥ÍcÍ̤̤̦̪h...
Ì Í
HÌµÌªÌ¥Ì Ì¼eÌÍÌ»ÌÌ̩̮ ÍÍwÌ·ÍÌÍÌÌÍh̡̩ÍÌ̯oÍÍ̱Í̲Í
ÌÍÍ¡WÌ Ì²Ḭ̹́͡aÍiÍ̼Ìt̯̻̻̰̮̱̹sÌÌÌÌ¦Ì ÌºÌ¥ ÌBÌÍ̤ÍeÌÌ«Í̤̩Íh̹iÌ̦̼ÍÌ n̸Í̲d̨ÍÍÍÍ
ÍÍÌ̻̲̮̹ÍT̸ÌÌÌ ÌÌ̤Ìh̨ÌÌèÍÌÍ
Ì®WÒÌ̹...
̤ÌÌ¦Ì Ì¬Z̤̺Í̦AÌÍLÍ̱G̶̰̺̲ÌÌ¥ÌÌ®OÌ©ÍÌ !̤ÌÌ
[credit to and shamelessly stolen from http://eemo.net]
=head1 SEE ALSO
http://eeemo.net/ - Zalgo Text Generator
=head1 AUTHOR
Chuck Adams <cja987@gmail.com>
=head1 LICENSE
This module is Copyright 2014 Chuck Adams.
This module is free software. It may be used, redistributed
and/or modified under the same terms as Perl itself.
( run in 3.351 seconds using v1.01-cache-2.11-cpan-524268b4103 )