Posts Tagged ‘keyboard’

Computer Poetry? Oh 01101110 01101111 01100101 01110100 01110010 01111001!

February 28, 2014

Computer poetry isn’t bad poetry. In fact, it’s not even un-human in many cases:

There’s some amazing poetry on the linked to site, botpoet.com, and I encourage you to check it out.

Can you write a program to create a human-like poem? Can you write a poem that’s totally computer-like? Put your attempts in the comments!

%   Created by David A. Gross. Copyright 2014.

T = 15;    B = 5;    L = 10;
enjamb = toeplitz(1:(T+2*B),(T+2*B+1):-1:2)';
enjamb = enjamb(randi(10,T+2*B,1),:);
A = [ repmat(' ',L,B) ...
      reshape(char(randi(255,L*T,1)),L,T) ...
      repmat(' ',L,B)];
A(end+1,:) = [repmat(' ',1,T+2*B-13) ' said the cat'];
A(sub2ind( ...
    [L+1,T+2*B], ...
    repmat((1:L+1)',1,T+2*B), ...
    enjamb(1:L+1,:)))

gives us:

          ñ          2s˜]ŸÊUK²]2©
          Pb          \caRRH_Y¡ô
          t          W[L‹Nžç{mڅõK
                …yþ!¸rÚg€ÞÍÐ?
          Ì          D—rŸŽR¹ƒ¬¿-+Å
          ý          ×JA}1¥ŒD©¨ëë
                –ِWhò+uÝßÚCE
                    õû–©˜¤?ç§ö˜jê F
                 ZAB"rÄ\[%4
                  /­M
          ¬#ÁW²ú*áØ
                       said the cat