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
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;
}