Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Shitty poetry [C]

Name: Anonymous 2011-08-07 4:12

I wrote this shitty program a-la http://robohash.org/
Enjoy your poetry
cc poemhash.c -lcrypto
./a.out sicp
river was like pumpkin-eater on the pines on the hem locks
midnight of their forgotten with chamber door was like wind
woodlands with midnight of their comedy of their tree
people with comedy of their forest of their stars



#include <stdio.h>
#include <string.h>
#include <openssl/md5.h>

const char *words[64] =
  { "sheen", "spears", "stars", "sea", "death", "pumpkin-eater", "boat", "river",
    "silver", "pines", "forest", "hem locks", "cradle", "coat", "music", "spring",
    "ivy-leaves", "green", "fresh", "deserts", "tears", "flow", "midnight", "weak",
    "volume", "forgotten", "chamber door", "snow", "woodlands", "fairy", "dream", "tree",
    "shore", "battle", "tribe", "people", "palace", "love", "highway", "loot",
    "comedy", "bones", "labour", "home", "wind", "change", "bird", "midnight",
    "life", "belongings", "tears", "eyes", "flame", "heart", "chastity", "magic",
    "flea", "marriage", "paradox", "distance", "sun", "theory", "automation", "history"
  };

const char *connectives[4] = { "was like", "on the", "of their", "with" };

void hashtopoem(const char *hash, FILE *out)
/* Convert hash to poem and write to out */
{
  const unsigned char *p = hash;
  int i, j, k, t;
  for(k = 0; k < 16; k++) {
    i = p[k] >> 2;
    j = p[k] & 3;
    t = (k + 1) % 4;
    fprintf(out, "%s %s%c", words[i], t ? connectives[j] : "", t ? ' ' : '\n');
  }
}

int main(int argc, char **argv) {
  char hash[16];
  if(argc == 2) {
    MD5(argv[1], strlen(argv[1]), hash);
    hashtopoem(hash, stdout);
  }
  return 0;
}

Name: Anonymous 2011-08-07 6:34

Exercises

1. Modify the program to automatically capitalize the first letter of each line.
2. Modify the program to generate verses of a given syllabic length.
3. Restrict the use of some connectives with some words.

Name: Anonymous 2011-08-07 6:43

You should write program, that produces mathematical texts. They would look totally authentic. Mathematics makes no more sense than a modern poetry.

Name: Anonymous 2011-08-07 8:05

I was able to produce a slightly coherent one, with 'crazyshit'.

fresh on the death on the music of their coat
cradle with hem locks was like flea on the spears
forgotten with change of their love on the change
loot on the shore of their flame was like life

Name: Anonymous 2011-08-07 8:19

>>4
Whoa, deep, dude.

Name: Anonymous 2011-08-07 8:55

is this just a glorified madlib

Name: Anonymous 2011-08-08 7:54

shameless self bump

Name: Anonymous 2011-08-08 7:54

>>7
please answer >>6

Name: MULTIVAC 2011-08-08 11:10

INSUFFICIENT DATA FOR MEANINGFUL ANSWER.

Name: Anonymous 2011-08-08 12:40

>>8
God says
bones was like fairy on the tree on the fairy
boat on the history with music with fresh
paradox on the hem locks of their palace was like midnight
snow with sea of their fairy on the fresh
magic on the pines of their paradox of their tribe
forest with belongings was like people on the boat
ivy-leaves was like music was like bird on the loot
deserts with magic with volume on the forest
home of their palace of their spears with ivy-leaves
marriage with woodlands of their life was like flea
cradle of their woodlands on the history on the forgotten
boat was like spring was like cradle was like palace

Name: Anonymous 2011-08-08 12:45

>>10 Upvote for "God says"

Name: IGBO MOHAMMED 2011-08-08 13:01

I REUIRE KNOWING OF 100 PROGRAMMER.

Name: Anonymous 2011-08-08 13:47

>>2

Follow-up Exercises:
4. Get a "complete" list of words
5. Separate into nouns, transitive/intransitive verbs, adjectives, adverbs, conjunctions, prepositions, and interjections
6. Two phases:
 6a. Hash to select a legitimate sentence structure (e.g. Interjection!  Noun adverb intransitive-verb, conjunction noun transitive verb noun.)
 6b. Hash to replace parts of speech with words from word list.

Name: 1 2011-08-08 14:23

>>13
This is easy in lisp but I don't know English grammar if anyone is willing to compile a small list I'll do it

Name: Anonymous 2011-08-08 15:52

>>14

no

Name: Anonymous 2011-08-08 16:50

sameless bump

Name: Anonymous 2011-08-08 17:08

http://www.dcs.shef.ac.uk/research/ilash/Moby/mpos.html
The "Moby" list of English words with part-of-speech tags.
Note that many words/phrases contain spaces or other punctuation.

Name: Anonymous 2011-08-08 17:10

>>17
There's that Simple English thing or whatever it's called which contains lists of words.

Name: Anonymous 2011-08-08 17:11

Name: Anonymous 2011-08-08 17:16

/usr/share/dict/words

Name: Anonymous 2013-06-20 8:20

wut

Name: Anonymous 2013-06-20 8:40

>>11
epic I like it, caught the reference too

Don't change these.
Name: Email:
Entire Thread Thread List