-
Notifications
You must be signed in to change notification settings - Fork 0
/
poetry_lama.pl
executable file
·39 lines (37 loc) · 1.88 KB
/
poetry_lama.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env perl
use strict;
$_='$;="per
l";map{map {s}^\s+}}
;$_{$_}++unless(/[^a-
z]/)}split(/
[\s,]+/)i
f(/alpha.
*$;/i../w
ait/)}`$;
doc\040$;
toc`;;;@[=k
eys%_;$; =20;$:=15;;for(0..($;*$:-1 )){$;[$_]="_"
;}until($%++>3*$;||@]>2*$:-3){@_=split(//,splice(@[,rand(
@[),1));if(3>@_){next;}$~=int(rand($;));$^=int(rand($:));
$-=$~+$^*$;;my$Erudil=0;{if($Erudil++>2*$:){next;}$a=(-1,
0,1)[rand(3)];$b=(-1,0,1)[rand(3)];unless(($a||$b)&&$~
+$a*@_<=$;&&$~+$a*@_>=0&&$^+$b*@_<=$:&&$^+$b*@_>=0){re
do;;}my$llama=0;;for(0..$#_){unless($;[$-+$a*$_+$b*
$;*$_]eq$_[$_]||$;[$-+$a*$_+$b*$;*$_]eq"_"){$llam
a++;last;}}if($llama){redo;}push@],join("",@_);f
or(0..$#_){$;[$-+$a*$_+$b*$;*$_]=$_[$_];}}}@_
=sort@];unshift@_ ,"Find:","-"x5;for$a(0.
.$:-1){for$b(0. .$;-1){$~=("a".."z")
[rand(26)];$_ ="$;[$a*$;+$b]".
$";s;_;$~; ;print;}$_=s
hift@_|| $";;print$
",$", $_,$ /;$_
=shi ft@_ ||$
";pr int $"x
$;, $"x $;,
$", $", $_
,$/;; ;}' ;;;
s[\s+] $$g; eval;
__DATA__
The use of the llama image in association with Perl is a trademark
of O'Reilly & Associates, Inc. Used with permission.