You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

407 lines
25 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ASCII Patch-making"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Fixed parameters"
]
},
{
"cell_type": "code",
"execution_count": 72,
"metadata": {},
"outputs": [],
"source": [
"characters = 82 # width\n",
"rows = 74 # height"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Patch 1: random shapes\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import random\n",
"\n",
"lines = []\n",
"shapes = ['░','▒','▓','▉','▚','▞']\n",
"\n",
"for linenumber in range(rows):\n",
" line = ''\n",
" for c in range(characters):\n",
" line += random.choice(shapes)\n",
" lines.append(line)\n",
"\n",
"patch = '\\n'.join(lines)\n",
"print(patch)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Patch 2: random numbers"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"lines = []\n",
"\n",
"import random\n",
"numbers = ['0','1','2','3','4','5','6','7','8','9']\n",
"\n",
"for linenumber in range(rows):\n",
" line = random.choice(numbers) * characters\n",
" lines.append(line)\n",
"\n",
"print('\\n'.join(lines))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Patch 3: -ing words, from Words for the Future\n"
]
},
{
"cell_type": "code",
"execution_count": 73,
"metadata": {},
"outputs": [],
"source": [
"# Collect all words of the Words for the future publications\n",
"\n",
"folder = 'txt/words-for-the-future/'\n",
"files = os.listdir(folder)\n",
"# print(files)\n",
"\n",
"bag = []\n",
"\n",
"for file in files:\n",
" \n",
" txt = open(folder+file).read()\n",
" words = txt.split()\n",
" \n",
" for word in words:\n",
" \n",
" word = word.strip()\n",
" word = word.lower()\n",
" \n",
" if word.endswith('ing'):\n",
" \n",
" bag.append(word)\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 74,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['refusing', 'affecting', 'understanding', 'burning', 'listening', 'reclaiming', 'ongoing', 'threatening', 'including', 'living', 'something', 'defending', 'cascading', 'interconnecting', 'facing', 'something', 'reworlding', 'devastating', 'reworlding', 'freeing', 'verifying', 'entailing', 'turning', 'affirming', 'including', 'taking', 'going', 'forgetting', 'resurrecting', 'reinventing', 'challenging', 'defining', 'uniting', 'belonging', '[b]getting', 'meaning', 'doing', 'destroying', 'protesting', 'mobilizing', 'obtaining', 'achieving', 'thing', 'devastating', 'holding', 'empowering', 'trying', 'caring', 'including', 'contaminating', 'reducing', 'feeling', 'deserting', 'protesting', '[b]making', 'addressing', 'diverging', 'dismembering', 'betraying', 'learning', 'reclaiming', 'consensus-making', 'giving', 'convoking', 'giving', 'everything', 'everything', 'being', 'refusing', 'playing', 'holding', 'something', 'partnering', 'composing', 'weaving', 'competing', 'having', 'weaving', 'living', 'emphasizing', 'worlding', 'mobilizing', 'becoming', 'losing', 'conquering', 'including', 'relinquishing', 'challenging', 'learning', 'tsing', 'paying', 'trusting', 'inviting', 'consenting', 'tsing', 'unravelling', 'weaving', 'trusting', 'relying', 'overbearing', 'including', 'stepping', 'conquering', 'interesting', 'enlightening', 'defining', 'weaving', 'weaving', 'having', 'having', 'sing', 'consenting', 'trusting', 'knowing', 'weaving', 'telling', 'learning', 'ongoing', 'concerning', 'daring', 'reclaiming', 'living', 'dying', 'standing', 'condescending', 'refusing', 'opting', 'sustaining', 'composing', 'learning', 'weaving', 'being', 'participating', 'contributing', 'giving', 'adding', '[i]dreaming', 'following', 'giving', 'affecting', 'living', 'learning', 'living', 'devastating', 'affecting', 'creating', 'poisoning', 'developing', 'living', 'cultivating', 'according', 'recovering', 'bio-diversifying', 'bringing', 'living', 'according', 'living', 'beating', 'representing', 'protecting', 'representing', 'understanding', 'banning', 'bring', 'beginning', 'something', 'everything', 'beginning', 'showing', 'bearing', 'giving', 'giving', 'taking', 'offering', 'offering', 'offering', 'covering', 'astonishing', 'living', 'living', 'representing', 'living', 'asking', 'living', 'referring', 'supporting', 'crying', 'supporting', 'keeping', 'demanding', 'protecting', 'understanding', 'offering', 'being', 'living', 'representing', 'surrounding', 'affecting', 'achieving', 'during', 'spraying', 'killing', 'producing', 'spoiling', 'regarding', 'recovering', 'mixing', 'creating', 'working', 'deciding', '“endangering', 'hiding', 'being', 'according', 'contaminating', 'doing', '“endangering', 'keeping', 'having', 'having', 'farming', 'importing', 'competing', 'endangering', 'losing', 'working', 'creating', 'looking', 'migrating', 'trying', 'nothing', 'nothing', 'touching', 'knowing', 'keeping', 'getting', 'something', 'preparing', 'offering', 'offering', 'keeping', 'cultivating', 'growing', 'harvesting', 'healing', 'learning', 'keeping', 'appropriating', 'living', 'living', 'something', 'finding', 'conserving', 'taking', 'keeping', 'growing', 'renewing', 'reinforcing', 'organizing', 'sharing', 'offering', 'taking', '(inter)acting', 'living', 'affecting', 'ignoring', 'developing', 'dealing', 'dealing', 'addressing', 'ending', 'living', 'feeding', 're-learning', 'living', 'multiplying', 'bringing', 'understanding', 'watching', 'knowing', 'understanding', 'being', 'involving', 'multiplying', 'producing', 'embracing', 'bringing', 'living', 'sharing', 'something', 'withdrawing', 'cancelling', 'being', 'losing', 'something', 'carrying', 'choosing', 'stepping', 'framing', 'mediating', 'investigating', 'bring', 'entering', 'creating', 'during', 'preserving', 'ongoing', 'multiplying', 'according', 'destabilising', 'conflicting', 'remaining', 'generating', 'connecting', 'connecting', 'being', 'understanding', 'mediating', 'conflicting', 'operating', 'inhabiting', 'being', 'glimmering', 'instituting', 'unfolding', 'acknowledging', 'creating',
]
}
],
"source": [
"print(bag)"
]
},
{
"cell_type": "code",
"execution_count": 70,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"------------unshackling---------------------------------------------------------\n",
"-------having-------------------------------------------------------------------\n",
"--------ongoing-----------------------------------------------------------------\n",
"----------following-------------------------------------------------------------\n",
"----------imagining-------------------------------------------------------------\n",
"------being---------------------------------------------------------------------\n",
"-------living-------------------------------------------------------------------\n",
"---------inviting---------------------------------------------------------------\n",
"--------morning-----------------------------------------------------------------\n",
"--------showing-----------------------------------------------------------------\n",
"-------taking-------------------------------------------------------------------\n",
"--------playing-----------------------------------------------------------------\n",
"------using---------------------------------------------------------------------\n",
"------------interesting---------------------------------------------------------\n",
"----------providing-------------------------------------------------------------\n",
"---------changing---------------------------------------------------------------\n",
"---------learning---------------------------------------------------------------\n",
"------------devastating---------------------------------------------------------\n",
"-----------everything-----------------------------------------------------------\n",
"------going---------------------------------------------------------------------\n",
"-----------developing-----------------------------------------------------------\n",
"-------boring-------------------------------------------------------------------\n",
"-------------representing-------------------------------------------------------\n",
"---------learning---------------------------------------------------------------\n",
"--------nothing-----------------------------------------------------------------\n",
"-------------“endangering-------------------------------------------------------\n",
"------being---------------------------------------------------------------------\n",
"--------leaving-----------------------------------------------------------------\n",
"--------“living-----------------------------------------------------------------\n",
"--------pushing-----------------------------------------------------------------\n",
"-----------forgetting-----------------------------------------------------------\n",
"---------offering---------------------------------------------------------------\n",
"------being---------------------------------------------------------------------\n",
"--------locking-----------------------------------------------------------------\n",
"-------naming-------------------------------------------------------------------\n",
"------being---------------------------------------------------------------------\n",
"-------making-------------------------------------------------------------------\n",
"----------belonging-------------------------------------------------------------\n",
"--------getting-----------------------------------------------------------------\n",
"-------------experiencing-------------------------------------------------------\n",
"-----------conquering-----------------------------------------------------------\n",
"-----------concerning-----------------------------------------------------------\n",
"------being---------------------------------------------------------------------\n",
"----------including-------------------------------------------------------------\n",
"-------making-------------------------------------------------------------------\n",
"----------achieving-------------------------------------------------------------\n",
"-------coping-------------------------------------------------------------------\n",
"--------working-----------------------------------------------------------------\n",
"-----------pretending-----------------------------------------------------------\n",
"-----------reworlding-----------------------------------------------------------\n",
"----------including-------------------------------------------------------------\n",
"--------------strengthening-----------------------------------------------------\n",
"--------relying-----------------------------------------------------------------\n",
"-----------connecting-----------------------------------------------------------\n",
"---------creating---------------------------------------------------------------\n",
"--------missing-----------------------------------------------------------------\n",
"--------talking-----------------------------------------------------------------\n",
"-------living-------------------------------------------------------------------\n",
"-----------conferring-----------------------------------------------------------\n",
"--------working-----------------------------------------------------------------\n",
"---------relating---------------------------------------------------------------\n",
"---------learning---------------------------------------------------------------\n",
"----------something-------------------------------------------------------------\n",
"--------looking-----------------------------------------------------------------\n",
"------using---------------------------------------------------------------------\n",
"-------seeing-------------------------------------------------------------------\n",
"--------playing-----------------------------------------------------------------\n",
"-------boring-------------------------------------------------------------------\n",
"--------chewing-----------------------------------------------------------------\n",
"-----------benefiting-----------------------------------------------------------\n",
"--------ongoing-----------------------------------------------------------------\n",
"-------------representing-------------------------------------------------------\n",
"--------falling-----------------------------------------------------------------\n",
"----------realizing-------------------------------------------------------------\n"
]
}
],
"source": [
"import os, random\n",
"\n",
"lines = []\n",
"\n",
"for linenumber in range(rows):\n",
" line = ''\n",
" word = random.choice(bag)\n",
" wordlength = len(word)\n",
" for i in range(characters-wordlength-2):\n",
" line += '-'\n",
" if i == wordlength:\n",
" line += word\n",
" lines.append(line)\n",
"\n",
"patch = '\\n'.join(lines)\n",
"print(patch)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Save your patch as a plain text (.txt) file"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"out = open('patches/shapes-patch.txt', 'w')\n",
"out.write(patch)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}