Ed Palmer – THATCamp Florida 2015 http://florida2015.thatcamp.org Sun, 01 Mar 2015 03:26:56 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.12 Poetry in 256 characters: PPG256-1 http://florida2015.thatcamp.org/2015/02/28/poetry-in-256-characters-ppg256-1/ Sat, 28 Feb 2015 14:12:52 +0000 http://florida2015.thatcamp.org/?p=262

In his book !# (pronounced “shebang”), Nick Montfort exhibits several short programs and the output of those programs. One program, PPG256-1 (Perl Poetry Generator 256, number 1) produces poetry from a dense Perl program of 256 characters.

In this session, we’ll look at PPG256-1 and how it does its magic, and perhaps talk about programming as both text and the creator of text.

PPG256-1:
sub b{@_=unpack"(A2)*",pop;$_[rand@_]}sub w{" ".b(cococacamamadebapanohamolaburatamihopodito).b(estsnslldsckregspsstedbsnelengkemsattewsntarshnknd)}{$_="\n\nthe".w."\n";$_=w." ".b(attoonnoof).w."\n" if $l;s/[au][ae]/a/;print;$l=0if$l++>rand 9;sleep 1;redo}

]]>