Skip to content

Instantly share code, notes, and snippets.

@aparrish
Created February 2, 2023 18:58
Show Gist options
  • Save aparrish/5db7ecb58fdc396385ac2f6aaa062725 to your computer and use it in GitHub Desktop.
Save aparrish/5db7ecb58fdc396385ac2f6aaa062725 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Implementations of early and well-known poetry generators\n",
"\n",
"By [Allison Parrish](http://www.decontextualize.com/)\n",
"\n",
"Here's my cool stuff yeah! Allison's class was very interesting and now I like poetry a lot!!!\n",
"\n",
"Here is the poetry I made with COMPUTERS!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## A House of Dust\n",
"\n",
"Original written in Fortran in 1967 by Alison Knowles and James Tenney. [ELMCIP entry](https://elmcip.net/creative-work/house-dust). [More information](http://blog.calarts.edu/2009/09/10/alison-knowles-james-tenney-and-the-house-of-dust-at-calarts/). [Watch Alison Knowles read from this piece](https://www.youtube.com/watch?v=-68Z708lFsY)."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import random"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"materials = [\n",
" \"cheese\",\n",
" \"ham\",\n",
" \"more ham\",\n",
" \"arugula\",\n",
" \"tofu for the vegans out there\"\n",
"]"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"locations = [\n",
" 'in the kitchen',\n",
" 'in my office',\n",
" 'outside'\n",
"]"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"lights = [\n",
" 'candlelight'\n",
"]"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"inhabitants = [\n",
" 'all races of men represented wearing predominantly red clothing',\n",
" 'children and old people',\n",
" 'collectors of all types',\n",
" 'fishermen and families',\n",
" 'french and german speaking people',\n",
" 'friends',\n",
" 'friends and enemies',\n",
" 'horses and birds',\n",
" 'little boys',\n",
" 'lovers',\n",
" 'people from many walks of life',\n",
" 'people speaking many languages wearing little or no clothing',\n",
" 'people who eat a great deal',\n",
" 'people who enjoy eating together',\n",
" 'people who love to read',\n",
" 'people who sleep almost all the time',\n",
" 'people who sleep very little',\n",
" 'various birds and fish',\n",
" 'vegetarians',\n",
" 'very tall people'\n",
"]"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"A house of ham\n",
" outside\n",
" using candlelight\n",
" inhabited by fishermen and families\n",
"\n",
"A house of tofu for the vegans out there\n",
" in my office\n",
" using candlelight\n",
" inhabited by french and german speaking people\n",
"\n",
"A house of ham\n",
" in the kitchen\n",
" using candlelight\n",
" inhabited by people who sleep almost all the time\n",
"\n",
"A house of ham\n",
" in my office\n",
" using candlelight\n",
" inhabited by people from many walks of life\n",
"\n",
"A house of arugula\n",
" in my office\n",
" using candlelight\n",
" inhabited by friends\n",
"\n",
"A house of ham\n",
" in the kitchen\n",
" using candlelight\n",
" inhabited by people who eat a great deal\n",
"\n",
"A house of cheese\n",
" in the kitchen\n",
" using candlelight\n",
" inhabited by horses and birds\n",
"\n",
"A house of cheese\n",
" outside\n",
" using candlelight\n",
" inhabited by all races of men represented wearing predominantly red clothing\n",
"\n",
"A house of arugula\n",
" in the kitchen\n",
" using candlelight\n",
" inhabited by friends\n",
"\n",
"A house of cheese\n",
" in the kitchen\n",
" using candlelight\n",
" inhabited by friends and enemies\n",
"\n",
"A house of ham\n",
" in my office\n",
" using candlelight\n",
" inhabited by all races of men represented wearing predominantly red clothing\n",
"\n",
"A house of more ham\n",
" in my office\n",
" using candlelight\n",
" inhabited by people from many walks of life\n",
"\n",
"A house of more ham\n",
" outside\n",
" using candlelight\n",
" inhabited by little boys\n",
"\n",
"A house of arugula\n",
" outside\n",
" using candlelight\n",
" inhabited by people from many walks of life\n",
"\n",
"A house of ham\n",
" in my office\n",
" using candlelight\n",
" inhabited by friends\n",
"\n",
"A house of cheese\n",
" outside\n",
" using candlelight\n",
" inhabited by fishermen and families\n",
"\n",
"A house of tofu for the vegans out there\n",
" outside\n",
" using candlelight\n",
" inhabited by fishermen and families\n",
"\n",
"A house of more ham\n",
" outside\n",
" using candlelight\n",
" inhabited by very tall people\n",
"\n",
"A house of tofu for the vegans out there\n",
" in the kitchen\n",
" using candlelight\n",
" inhabited by people who eat a great deal\n",
"\n",
"A house of arugula\n",
" in my office\n",
" using candlelight\n",
" inhabited by children and old people\n"
]
}
],
"source": [
"stanza_count = 20\n",
"for i in range(stanza_count):\n",
" print()\n",
" print(\"A house of \" + random.choice(materials))\n",
" print(\" \" + random.choice(locations))\n",
" print(\" using \" + random.choice(lights))\n",
" print(\" inhabited by \" + random.choice(inhabitants))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment