From c01186a6d23bc2d4226b7cae993f6facbe0d928f Mon Sep 17 00:00:00 2001 From: manetta Date: Mon, 21 Sep 2020 18:08:17 +0200 Subject: [PATCH] uploading two notebooks, work in progress --- patterns-generating.ipynb | 1055 ++++++++++++++++++++++++++++++++++ patterns-searching-for.ipynb | 46 ++ 2 files changed, 1101 insertions(+) create mode 100644 patterns-generating.ipynb create mode 100644 patterns-searching-for.ipynb diff --git a/patterns-generating.ipynb b/patterns-generating.ipynb new file mode 100644 index 0000000..1f870ff --- /dev/null +++ b/patterns-generating.ipynb @@ -0,0 +1,1055 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Patterns (part 1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Generating patterns" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Generating patterns, weaving & textile design.\n", + "\n", + "> One of the most ancient crafts, hand weaving is a method of forming a pliable plane of threads by interlacing them rectangularly. Invented in a preceramic age, it has remained essentially unchanged to this day. Even the final mechanization of the craft through introduction of power machinery has not changed the basic principle of weaving. (p. 19)\n", + "\n", + "> The structure of a fabric or its weave — that is, the fastening of its elements of threads to each other — is as much a determining factor in its function as is the choice of the raw material. In fact, the interrelation of the two, the subtle play between them in supporting, impeding, or modiying each other's characteristics, is the essence of weaving. (p. 38)\n", + "\n", + "Anni Albers - On Weaving (1965), https://monoskop.org/images/7/71/Albers_Anni_On_Weaving_1974.pdf\n", + "\n", + "![Red-Geen Slit Tapestry, Gunta Stölzl (1927/28)](https://monoskop.org/images/e/ef/Stoelzl_Gunta_1927-28_Red-Green_Slit_Tapestry.jpg)\n", + "\n", + "Red-Geen Slit Tapestry, Gunta Stölzl (1927/28)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "-------------------" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Re-turning (to): Variables, Lists & Loops" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "words = ['weaving', 'with', 'words', 'and', 'code']" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "weaving\n", + "with\n", + "words\n", + "and\n", + "code\n" + ] + } + ], + "source": [ + "# First a simple loop through the list\n", + "for word in words:\n", + " print(word)" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "code weaving weaving code words\n", + "with with and code and\n", + "code code weaving and with\n", + "and weaving words code and\n", + "and with words words weaving\n" + ] + } + ], + "source": [ + "# Then, a loop in which we start to play with random again\n", + "import random\n", + "for word in words:\n", + " print(random.choice(words), random.choice(words), random.choice(words), random.choice(words), random.choice(words))" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "\u001b[0;31mInit signature:\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m/\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mDocstring:\u001b[0m \n", + "range(stop) -> range object\n", + "range(start, stop[, step]) -> range object\n", + "\n", + "Return an object that produces a sequence of integers from start (inclusive)\n", + "to stop (exclusive) by step. range(i, j) produces i, i+1, i+2, ..., j-1.\n", + "start defaults to 0, and stop is omitted! range(4) produces 0, 1, 2, 3.\n", + "These are exactly the valid indices for a list of 4 elements.\n", + "When step is given, it specifies the increment (or decrement).\n", + "\u001b[0;31mType:\u001b[0m type\n", + "\u001b[0;31mSubclasses:\u001b[0m \n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# How to work with more iterations of the loop? \n", + "# For example 100?\n", + "# You can use \"range\"\n", + "range?" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "words with and code words\n", + "words words and weaving with\n", + "and and and and code\n", + "words code weaving with weaving\n", + "code code code with weaving\n", + "and weaving weaving and with\n", + "weaving with words with and\n", + "and words and weaving and\n", + "words weaving code code weaving\n", + "code words words with code\n", + "weaving with words and code\n", + "weaving and and words weaving\n", + "and weaving weaving and words\n", + "with code weaving weaving and\n", + "with words words code with\n", + "code with weaving and weaving\n", + "weaving weaving weaving with with\n", + "weaving and code code with\n", + "words weaving and and weaving\n", + "weaving words weaving weaving weaving\n", + "with and with weaving and\n", + "and weaving with code code\n", + "code words words and code\n", + "weaving weaving weaving words and\n", + "and words words with and\n", + "and code code code weaving\n", + "weaving weaving words weaving with\n", + "words and code with code\n", + "weaving words and code code\n", + "and words words words words\n", + "weaving and code code weaving\n", + "with with words weaving and\n", + "words code weaving weaving code\n", + "code words words weaving weaving\n", + "words words code code words\n", + "words weaving with and and\n", + "with and and with and\n", + "with code code with words\n", + "with code code with words\n", + "words words and words code\n", + "code weaving words code code\n", + "weaving words and with with\n", + "with with weaving words and\n", + "weaving weaving weaving words code\n", + "and and weaving weaving weaving\n", + "code words code weaving weaving\n", + "with code and and code\n", + "with weaving weaving code words\n", + "and code weaving words with\n", + "and words words weaving weaving\n", + "with code with with code\n", + "weaving weaving code words words\n", + "and and and and words\n", + "words with weaving code weaving\n", + "words code with with code\n", + "code with with code code\n", + "and weaving and words code\n", + "code code with words and\n", + "code code and and words\n", + "and with words weaving weaving\n", + "with weaving with with and\n", + "words and words and with\n", + "weaving code words code words\n", + "with weaving with words words\n", + "weaving words and with and\n", + "code words and words and\n", + "and weaving weaving code code\n", + "with words and code words\n", + "with code weaving code code\n", + "code words code weaving and\n", + "words words code code weaving\n", + "weaving code and with and\n", + "with weaving with weaving words\n", + "with weaving and words and\n", + "and weaving words code and\n", + "with weaving with and code\n", + "weaving words with with words\n", + "words with weaving words and\n", + "weaving and words words words\n", + "with words weaving and and\n", + "weaving code weaving and words\n", + "weaving words weaving with code\n", + "with words and weaving weaving\n", + "code words with with code\n", + "weaving words words and weaving\n", + "and words words with and\n", + "and with code weaving code\n", + "code weaving words and weaving\n", + "with weaving words and and\n", + "code weaving and weaving and\n", + "with weaving code with weaving\n", + "and weaving code code with\n", + "and code words weaving words\n", + "and words weaving with code\n", + "words words weaving words with\n", + "code with with code and\n", + "words with code and code\n", + "code and and words with\n", + "with with words weaving and\n", + "words with weaving words and\n" + ] + } + ], + "source": [ + "# Make a loop that starts at 0 and ends at 99 (100 iterations)\n", + "import random\n", + "for number in range(100):\n", + " print(random.choice(words), random.choice(words), random.choice(words), random.choice(words), random.choice(words))" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3\n", + "4\n", + "5\n", + "6\n", + "7\n", + "8\n", + "9\n" + ] + } + ], + "source": [ + "# You can use range also differently, for example to loop in between two numbers ...\n", + "for number in range(3,10):\n", + " print(number)" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n", + "10\n", + "20\n", + "30\n", + "40\n", + "50\n", + "60\n", + "70\n", + "80\n", + "90\n" + ] + } + ], + "source": [ + "# ... or with bigger steps:\n", + "for number in range(0,100,10):\n", + " print(number)" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x y\n", + "x yy\n", + "x yyy\n", + "x yyyy\n", + "x yyyyy\n", + "xx y\n", + "xx yy\n", + "xx yyy\n", + "xx yyyy\n", + "xx yyyyy\n", + "xxx y\n", + "xxx yy\n", + "xxx yyy\n", + "xxx yyyy\n", + "xxx yyyyy\n", + "xxxx y\n", + "xxxx yy\n", + "xxxx yyy\n", + "xxxx yyyy\n", + "xxxx yyyyy\n", + "xxxxx y\n", + "xxxxx yy\n", + "xxxxx yyy\n", + "xxxxx yyyy\n", + "xxxxx yyyyy\n" + ] + } + ], + "source": [ + "# Now... write a loop in a loop\n", + "for x in range(1,6):\n", + " for y in range(1,6):\n", + " print('x'*x, 'y'*y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---------------------------------------" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### ASCII canvas" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A not-too-big next step is to start generating patterns!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![](https://monoskop.org/images/1/1d/Albers_Anni_nd_Typewriter_Studies.jpg)\n", + "\n", + "> These varied experiments in articulation are to be understood not as an end in themselves but merely as a help to us in gaining new terms in the vocabulary of tactile language. (On Weaving, Anni Albers (1965))\n", + "\n", + "Anni Albers - Typewriter Studies" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n", + "sSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS\n", + "____________________________________________________________________________________________________\n" + ] + } + ], + "source": [ + "# We could replicate Anni's typewriter study now!\n", + "width = 100\n", + "height = 20\n", + "for y in range(height):\n", + " print('sS' * 50)\n", + " print('_' * width)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**mini-exercise**: try to replicate the other typewriter study yourself now!" + ] + }, + { + "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": 85, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "▓░▓▚▚▓▞▒▓▒▞▓▉▓▚░▚░▚▒▓░░▞░▉▓▚░▓▒▒▞░▒▒▚▒▚▒▞▚▓░▞▓▉░▞▒▒░░░▉░▚▞▞▒▞▒▉▒▓▒░▒▓▞▉▉▉▒▓▚▓▞▞▚▉▉▒▚▉▉░░▓▞▉▒▒░▞░▞▉░▉\n", + "░▞░▉░░▚▉▉▓▓▚▚▞▓▉▓░▒░░▚▓░▉▚▉░▉▒▚▞▒▞▓▒░▓▓░▒▚▉▉░▚░▓▓▓░▉░▒░▉▓▒▞▉▉▉░▒▞▒▒▒▒▉▓▒▓▒▒▒▓▉▉▚▞▓▉▓▞▓▒▞▚▒▞░▞▉▓▓▞▉▓▒\n", + "▓▓▓▉▚▓░▞▉▚▚▚░▚▓▉▞▓░▉▓▞▚▚▚▚░▓░▚▒▉▚▉▞░▒▉▒▞▚▞▚▞▞▚▉▚░▉▓▚▚▚▒▞░▞▓▉▉▚▓▓▚▉▞▓░░▉░▚▓▞░▞▚▚░▓▒▚▓▓▞▞▓▞▓▒▚▒▚▓▚▉▒▚▉\n", + "▓▞▉░▉░░▒▞▒▒▒▚▞▞▚▚▚▞▉▉▚▞▚░░░▓▉▚▚▞▉▚▓▉▓▉▉▉▒▚░▉▓▓░▚▞▚▉▉▒░▚░▚▞▉▚▓▉▚▚▚▉▚▉▒▒▚▉▓▒▓▚▉▉▞▒▞░▉▚▒░▉▒▚▚▒▒░▉▞▓▞▞▞▒\n", + "▓▓░▞▒▉░░░▓▞▉▉▚▞▞▒▞▚▚▉▉░▚▚▉▓░░░▚▞▓▚▓▓▞▞░▞░▉▉▓▞▒▓▒▚▒▉▒▓░▓░▉▓▓▚▉▉▉░▒▞▓▉▉▓▒▞▒▉▚░▉▚▒▒▒▒▚▚▚░▞▚░▉▚▞▞▞▞▚▒░▉▓\n", + "▉▒▚▓▓▓▓▓▚▒▓▚▒▞▉░░▞▒▒▒▓▒░▓▓▞▞▞▓▉░▒▒░▒▉░▞▚▚▚▉▒▓░▞▚░░▚▚▉▉▓▒▒▚▓▓▒▓▉▓▞▒▚▞▒▓▉▓▒░▚▉▒▉▉▓▚▒░▉▚▓░▒▚▞▒░▓░▞▉░▓░░\n", + "▓▓▒░▒▒░▉░░▚▚▞░▉▒▚▒▒▉▞▓▚▓▉▚▓▞▚▚▚▒▉▉░░▞░▒▉▉░▉▉▓▉░░▚▉▚▉▒▒▒▞░░▓▚▞▓▓▉▉░░░▞▒▚▚▞▉░▚▒▚▚▚▞▒▒▞▚▒▞▞▓▞▞▉▚▞▒▚▒▓░▉\n", + "▚▞▞▉▒▉▞░▚▒░▚▒▉▞▓▉░▓▓░▞▞▓▓▉▓▞▒░▞▒▓▞▒▞▓▓▉▒▒▓▉▚▒░▚▒▓▒▓░▚▉▒░░▞▞▞▓▓▓▒░▉▞░▓▚▉▞▚▉▞▓▞▚▒▉▒░░▓▒░░░▚▓░▉▓▞▞▓▞▚░▚\n", + "▒▉▓░▒▉▒▉░▒▒▚▓▒▓▒▒▞▞▒▒▒▚▚▓▚▚▞░▓▒▚▉▞▞▚▒▒▞▚▉▉▞░▉▚▚▉▞▒░▞▒▒░▒▓▚▓▚▞▒▒░▒▞▚▓▒▓▒▞▉▉▞▞▚░░░░▒▉▚▚░▒▓▒▉▞░░▉▉▞▞▉▒▞\n", + "▓▞▞▚░▒▓▓▒▚░▉░▒▚▞░▉▉▉▓▚▚▉▚▒░▉▉▒▒▚▓░▒▒░▉▚▉▓▞▓▚▓▉▓▓▚▒░▓▓▉▒▒▞▒▓▒▞▚░░▒░░░▚░▞▓▚▓▓▒▒▓▞▉▓▉▓▉▒▓▒▚░▚▒▚▚░▉▒▉▓▓▞\n", + "▚░▒▓▉▉░▞▚▓▞▓▓▞▓▚▓▚▒▞▉▒▚▚▉▓▉▒▚░▉▚▞▒▉▉▒▒▒▞▉▒▉▒▓▞▚▓▓▒░▓▞▓▉▓▞▉▉▞▓▚▓▚▒▞▉▓▚▒▒▓▚▓▒▞░▉▉▞▚▓▉▚░░▚▉▓░▓▞░░▉▞▞░░▚\n", + "▓▒░▓░▒▉▞▓▚▞▒▒▚▒▓▒▒▓▓▞▞░▒▒▚▞░▒░▓▓░▉░▉▒▓▉▉▉▒▓▒░▓▓▚▚▚▓░▉▓▞▉▚▓▉▞▚▉░▚▒▉▞▓░▓▒▓▚▉▞░▞▒▉▉░▒░▉▞▞▒▓░▓▓░▉▉░▚▉▚▚▚\n", + "▓▚▒▞▞▞▚▒░▒▒▒▒▓▞▒▉▓░░░▒▒▓▓▒▓▚▉▚░▓▞▒░▓▞▞▉▚░▉▒▞▓▚▓▉▓▒░▞▒░▞▓▉░░▒░▒▉▒▞▞░▉▉░▒▞▉▓░▒▓▒░▒▓▓░░▒░▉▉▒▚▒▒▒▉▉▚░▞▞░\n", + "▞▉▉░▉▒░▚▞▒▒▒▒▞░▚▒▒░░░▉▞▒▉▓▚▚▞▚░▒▚▉▓░▞▞▚▚▒▒▒▚░▓▉▒░▉▉▓▞▒▓▚▞▓▒▚▉▓░░▚▞▒▉▞▓▓▞▚▉▞░▒▉▉▞▚▉▒▓▒░▞░▒░░▒▞▚▞▉▞▉▞▒\n", + "▓▉▓▓░░▉▞▒▉░▉░▞░▚▚░▉▚▞▒▒▞▉░▓▓▓▓▚▞▞░▒▓▞▓▓▒▒▒▒▒▉▒▉▓▚▉▉▓░▒▓▉▚▓▚▉▞▞▚▒░▞▚▚░▉▓▞░░▚▓▞░▒▉▉▚▓▓▉▉▓▞▓▚▚▒▉▞░▚▒░▓▓\n", + "▚▚▞▒▉░▚▞▓▒▞▉▚▚▉▞▓▞▓▒▞▉░▒▒▉▞▉░▚▓▞▒▞▞▚▓▓▚▓░▒▉▒▚▞▞▒▓▚▓▉▞▚▉░▚▉▚░░▉▒▚▞░▚▞▉░▚▞▞▞▒▒░▓▉▉▓▞▚▒▉▒▉▓▞░▓▚▚▚▉▒▒▓░▓\n", + "▉▚▉▞░▒▉░▓░▒▉▚▚▉▞░▉▉▞░░▞▒▒▓▒▒▒▓▚░▉▚░▞▒░▉▚▓▒▚▒▚░░▉▒░▉▓▉▚▓▓▒▒▒▉▞▉░▚▚▉▞▓░▒▞▉▚▒▉▉░▉▚▚▚▞░▓▒▚▚▚▚░▓▞░░▒░▒▒░▉\n", + "▉▓▚░▒▓░▒▚▞▞░▒▒▒▚░▉░▓▒▞▞▚▞▚▉▚░▚▒▒▒░▓▚▚▒▉░▉▞▓▒▞▉░▚▚▚▉▚▒▞▓▞▚▓░▞▚▞▉▉▞▚▓▞░▚▒▉▞▓▉▓▚▒▞▒▞▉▚▒▓▚▉░░▚▒▞▒▓▒▉▒▚▓░\n", + "▒▞▉▉▒▉▒▉▓░▓▓▓▚▒▚▓░▓▚▞▞▓▚▉▉▚▚▒▚▞▞▞▞▓░░▒▓▉▒░▓░▚▓▞▉▓▓▒▚░▒░▓▞▚▚▚▒▒▓▚▒░▓▉░▞▉▒░▚▚▞▞▒▞▓▞▞▚▞▒▓▚▞▚▉▚▒░▉▉░▒░▉▒\n", + "▚▚▞▞▓▒░▉▞▓░▒▒░▚▓▒▉▞▒▓▒▓▉░░▞▉▒▞▞▚▒▉▚▉▚▞▓▞▚▒░▚░▓▉▚▞▚▚▞▞▓▓▉░▞▒▒▓▒▓▒░▚▓▞▒▞▚▒▒▚▒▞▓░▞▒▉▞▚▉▞▞░░▉▚▞▚▓░▚▒▉▞░▚\n", + "▓▞▚▚▚▚▒▒▉▉▞▉▉▞▞▚▉▓▚▓▚░▞▞▒▓▉▚▓▉▞▚▒░▉▓▉░▞▓▚▓▒▓▒▒▉▓░▚▒▚▒▉░▒▓▉▚▉▉▚▒▒▓▉▉░▉░▞▉░░▞▒▒░▚▓▉▓▓▚▞▞▞▓▓▒░▚▓▒▚▉░▒▚▓\n", + "░░▒▚▉░▉▞▓░░▉▞░░▞░▉▉▓░▒▞▒▞░▒░▚▚▒▚▉▚░▒▒▓░░▞▓▒▉░▚▓▉░▚▚▓▓▉▉░▓▚▉░▒░▚░▉▉▚▒▚▉▚▒░▞░▚▒▞▓░▓▞▚▚▒░▓░▉░▞▓▞▞░▓▉▚▉▉\n", + "▞▒▚▉▞░░▉▚▉▉▉▉▉▓▉▞░▚▚▚░▓░▉▚░▉▉▞░▉▉▓▓▒▚▉▉▚▞░▞▚▉▚▚▉▓░▉▚▉▒▒▉▒▚▒░░░▚▒▞▒▒▚▉▓▞▒▒▞▒▞▚▒▚░▓░▓░▓▒▓▓▉▉▓▓▉▒▚▒░▞▓▓\n", + "▞▚░▒▓▚▓▉▒▚▉▓▉▞▚▚░▉▒▞▒▓▉▞▒▞▓▉▒▓▞▞▚▓▒▒░▞▞░▓▉▞░░▒▞▚▒░▉▉▚▉▚▓▞▚▞▞▞▒░░▉▞▒▚▓▞▒▞░▚▉▓▚░▉░▓░▚▉▉▒░▓▒░▚▞▓▓░▚▓░▚▓\n", + "▓▚▞▒▚▞░▚░▒▚▞▒▒▓▞▉░▓▉▓░░▚▓▒▒▞░▒▓▚▓▉▓▞░▒▞▉▓▉░▚▒▚▉▉▓▉▒▚▒▒▉▞▒▉▚▒▓▉░▚▞▉▚▓▞░▒▚▓░▚▓▓▞▒▓▓░░▞░▚▒▓▉▚▒▒░▒▒▚▒░▒▚\n", + "▞▉░▉▚▓▞▓▚▉▚▞▞▓░▞▞▓▉▚▉▓▞▉▚▒▞▒▒▚▒▓▚▞▞░▉▞▓▞▓▞░░▒▞▚▞▉▚▒░▚▓▞▚▒▉▚▉▓▉▞▚▚▚▓▒░▚▓▞▉░▒▞▒▉░▚▓▞▉░░▚░▉▉▒░▞▞▞░▚▞▚▒▚\n", + "▒▚▞▞▉▞▒▉▞░░▉░▞▓▓▒▞▞▓░░▞░▉▒▚▞▞▚▒▚▉▒▒▞▓░▞▓▚▉▞░▞▒░▉▒▉▞▓▞░▉▞▓▚▉▉▓▞▓░▓▒▓░░▚▚▞▚▞▞▚░▒▉▚▒░░▓▞▒▒▞▓▉▒▚░▓▒▉▉░▒░\n", + "░▚░▞▓▚░▉░▞▞▞▉░▉▞▉░▉▓▉▉▞░▞▚▞▒▚▒▞▞▉░▉░▞▒▚░▉░▞▒▞▉▒▚▒▞▞░░▓▉▚▞▒▞▒▉▉▓▉▚▉▓▞▞▚▞▓▒░▉▚▓▚▓▓▓▓▒▒░░▒▉▞▞▚░▚▚▞▞▓▉▞▞\n", + "▒▓░▞▒░▒░▓▓▉▞▉▉▚▉▓▉▞░▉▞▓▒▓▒▓▉▓▒▚░░▓▚▚▓▓░░▓▞▓▓▉░▒▚░▞░▒▞▓░▒▞▞▓▉▉▉▒░▉▉▓░▒▞▚▚▒▉▒▉▓▞▚▓▚░▉▞▞▓▞▚▚▒▞▚▉▞▓▒▉▓▒▒\n", + "▉▒▓▞▓░░▞▉▓▉░▚▞▚▓▒▚▓▞▞▞▞░▒▒▚▚▉▞░▒▞▞▓▚▞▞▓▉▒▒▓▒▚▞▉▚▚▒▓▚▚▞▚▓▉░▚▓▚▚▚▉▚▞▞░▓▞░▒▚▒▞▓░▚▒▓▞▓▞░▉▉░▞░▉▞▚▓▚░░▓▒▒▓\n" + ] + } + ], + "source": [ + "# Let's continue a bit with this \"canvas-mode\" of working, \n", + "# and let's bring the random function to the table again!\n", + "import random\n", + "characters = ['░','▒','▓','▉','▚','▞']\n", + "width = 100\n", + "height = 30\n", + "line = ''\n", + "for y in range(height):\n", + " for x in range(width):\n", + " line += random.choice(characters)\n", + " print(line)\n", + " line = ''" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 107, + "metadata": {}, + "outputs": [], + "source": [ + "# Let's also make different kind of patterns, without the random function this time.\n", + "sentence = 'weaving with words and code'\n", + "line = ''\n", + "for y in range(5):\n", + " for x in range(100):\n", + " line += sentence\n", + " line += ' ' * x" + ] + }, + { + "cell_type": "code", + "execution_count": 108, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "weaving with words and codeweaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and codeweaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and codeweaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and codeweaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and codeweaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code weaving with words and code \n" + ] + } + ], + "source": [ + "print(line)" + ] + }, + { + "cell_type": "code", + "execution_count": 109, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "weaving with words and codeweaving with words and code weaving with words and code weaving with wo\n", + "ds and code weaving with words and code weaving with words and code weaving with words and\n", + "code weaving with words and code weaving with words and code weaving with words a\n", + "d code weaving with words and code weaving with words and code weaving w\n", + "th words and code weaving with words and code weaving with words and code \n", + " weaving with words and code weaving with words and code weav\n", + "ng with words and code weaving with words and code weaving with wo\n", + "ds and code weaving with words and code weaving with words and\n", + "code weaving with words and code weaving with words and co\n", + "e weaving with words and code weaving with words and c\n", + "de weaving with words and code weaving with words \n", + "nd code weaving with words and code weaving wi\n", + "h words and code weaving with words and code \n", + " weaving with words and code weaving with words and code \n", + " weaving with words and code weaving with words a\n", + "d code weaving with words and code \n", + " weaving with words and code weaving with words and code \n", + " weaving with words and code weavi\n", + "g with words and code weaving with words and code \n", + " weaving with words and code weav\n", + "ng with words and code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving with words and\n", + "code weaving with words and code \n", + " weaving with words and code \n", + "eaving with words and code weaving with words and c\n", + "de weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving wi\n", + "h words and code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving w\n", + "th words and code weaving with words and\n", + "code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + "weaving with words and code \n", + "eaving with words and code \n", + "eaving with words and code \n", + "weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and\n", + "code weaving w\n", + "th words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving wi\n", + "h words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and c\n", + "de \n", + "eaving with words and code \n", + " weaving with words and code \n", + " weaving with words and codeweaving with words and\n", + "code weaving with words and code weaving with words and code weaving with words and code weav\n", + "ng with words and code weaving with words and code weaving with words and code weavi\n", + "g with words and code weaving with words and code weaving with words and code \n", + " weaving with words and code weaving with words and code weaving with words a\n", + "d code weaving with words and code weaving with words and code \n", + " weaving with words and code weaving with words and code weaving wi\n", + "h words and code weaving with words and code weaving with words \n", + "nd code weaving with words and code weaving with words and c\n", + "de weaving with words and code weaving with words and co\n", + "e weaving with words and code weaving with words and\n", + "code weaving with words and code weaving with wo\n", + "ds and code weaving with words and code weav\n", + "ng with words and code weaving with words and code \n", + " weaving with words and code weaving with words and code \n", + " weaving with words and code weaving w\n", + "th words and code weaving with words and code \n", + " weaving with words and code weaving with words a\n", + "d code weaving with words and code \n", + " weaving with words and code weaving with words and\n", + "code weaving with words and code \n", + " weaving with words and code weaving with wo\n", + "ds and code weaving with words and code \n", + " weaving with words and code \n", + "weaving with words and code weaving with words and co\n", + "e weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving with words \n", + "nd code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving with w\n", + "rds and code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weavi\n", + "g with words and code weaving with w\n", + "rds and code weaving with words and\n", + "code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and\n", + "code weaving with w\n", + "rds and code weavi\n", + "g with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with w\n", + "rds and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words \n", + "nd code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and co\n", + "e \n", + "weaving with words and codeweaving with words and code weaving with words and code weaving with wo\n", + "ds and code weaving with words and code weaving with words and code weaving with words and\n", + "code weaving with words and code weaving with words and code weaving with words a\n", + "d code weaving with words and code weaving with words and code weaving w\n", + "th words and code weaving with words and code weaving with words and code \n", + " weaving with words and code weaving with words and code weav\n", + "ng with words and code weaving with words and code weaving with wo\n", + "ds and code weaving with words and code weaving with words and\n", + "code weaving with words and code weaving with words and co\n", + "e weaving with words and code weaving with words and c\n", + "de weaving with words and code weaving with words \n", + "nd code weaving with words and code weaving wi\n", + "h words and code weaving with words and code \n", + " weaving with words and code weaving with words and code \n", + " weaving with words and code weaving with words a\n", + "d code weaving with words and code \n", + " weaving with words and code weaving with words and code \n", + " weaving with words and code weavi\n", + "g with words and code weaving with words and code \n", + " weaving with words and code weav\n", + "ng with words and code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving with words and\n", + "code weaving with words and code \n", + " weaving with words and code \n", + "eaving with words and code weaving with words and c\n", + "de weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving wi\n", + "h words and code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving w\n", + "th words and code weaving with words and\n", + "code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + "weaving with words and code \n", + "eaving with words and code \n", + "eaving with words and code \n", + "weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and\n", + "code weaving w\n", + "th words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving wi\n", + "h words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and c\n", + "de \n", + "eaving with words and code \n", + " weaving with words and code \n", + " weaving with words and codeweaving with words and\n", + "code weaving with words and code weaving with words and code weaving with words and code weav\n", + "ng with words and code weaving with words and code weaving with words and code weavi\n", + "g with words and code weaving with words and code weaving with words and code \n", + " weaving with words and code weaving with words and code weaving with words a\n", + "d code weaving with words and code weaving with words and code \n", + " weaving with words and code weaving with words and code weaving wi\n", + "h words and code weaving with words and code weaving with words \n", + "nd code weaving with words and code weaving with words and c\n", + "de weaving with words and code weaving with words and co\n", + "e weaving with words and code weaving with words and\n", + "code weaving with words and code weaving with wo\n", + "ds and code weaving with words and code weav\n", + "ng with words and code weaving with words and code \n", + " weaving with words and code weaving with words and code \n", + " weaving with words and code weaving w\n", + "th words and code weaving with words and code \n", + " weaving with words and code weaving with words a\n", + "d code weaving with words and code \n", + " weaving with words and code weaving with words and\n", + "code weaving with words and code \n", + " weaving with words and code weaving with wo\n", + "ds and code weaving with words and code \n", + " weaving with words and code \n", + "weaving with words and code weaving with words and co\n", + "e weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving with words \n", + "nd code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving with w\n", + "rds and code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weavi\n", + "g with words and code weaving with w\n", + "rds and code weaving with words and\n", + "code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and\n", + "code weaving with w\n", + "rds and code weavi\n", + "g with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with w\n", + "rds and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words \n", + "nd code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and co\n", + "e \n", + "weaving with words and codeweaving with words and code weaving with words and code weaving with wo\n", + "ds and code weaving with words and code weaving with words and code weaving with words and\n", + "code weaving with words and code weaving with words and code weaving with words a\n", + "d code weaving with words and code weaving with words and code weaving w\n", + "th words and code weaving with words and code weaving with words and code \n", + " weaving with words and code weaving with words and code weav\n", + "ng with words and code weaving with words and code weaving with wo\n", + "ds and code weaving with words and code weaving with words and\n", + "code weaving with words and code weaving with words and co\n", + "e weaving with words and code weaving with words and c\n", + "de weaving with words and code weaving with words \n", + "nd code weaving with words and code weaving wi\n", + "h words and code weaving with words and code \n", + " weaving with words and code weaving with words and code \n", + " weaving with words and code weaving with words a\n", + "d code weaving with words and code \n", + " weaving with words and code weaving with words and code \n", + " weaving with words and code weavi\n", + "g with words and code weaving with words and code \n", + " weaving with words and code weav\n", + "ng with words and code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving with words and\n", + "code weaving with words and code \n", + " weaving with words and code \n", + "eaving with words and code weaving with words and c\n", + "de weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving wi\n", + "h words and code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code weaving w\n", + "th words and code weaving with words and\n", + "code weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + "weaving with words and code \n", + "eaving with words and code \n", + "eaving with words and code \n", + "weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and\n", + "code weaving w\n", + "th words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving wi\n", + "h words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and code \n", + " weaving with words and c\n", + "de \n", + "eaving with words and code \n", + " weaving with words and code \n" + ] + } + ], + "source": [ + "# In order to show the pattern nicely, \n", + "# we will not loop over the produced variable \"line\" again\n", + "# and cut the line off after 100 characters.\n", + "tmp_line = ''\n", + "for character in line:\n", + " if len(tmp_line) < 99:\n", + " tmp_line += character\n", + " else: \n", + " print(tmp_line)\n", + " tmp_line = ''\n", + " count = 0" + ] + }, + { + "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": [] + } + ], + "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 +} diff --git a/patterns-searching-for.ipynb b/patterns-searching-for.ipynb new file mode 100644 index 0000000..6353666 --- /dev/null +++ b/patterns-searching-for.ipynb @@ -0,0 +1,46 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Patterns (part 2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Searching for patterns" + ] + }, + { + "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 +}