Skip to content

Instantly share code, notes, and snippets.

@veretennikovalexey
Created June 26, 2022 18:13
Show Gist options
  • Save veretennikovalexey/99f82131a731cf3a03cf4875ce1c269e to your computer and use it in GitHub Desktop.
Save veretennikovalexey/99f82131a731cf3a03cf4875ce1c269e to your computer and use it in GitHub Desktop.
zigzag.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "zigzag.ipynb",
"provenance": [],
"authorship_tag": "ABX9TyNLV1RRhFaL6Lwpgu/ARI2t",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/veretennikovalexey/99f82131a731cf3a03cf4875ce1c269e/zigzag.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "wlpqG0NbMzvh"
},
"outputs": [],
"source": [
"import time, sus\n",
"indent = 0\n",
"indentIncreasing = True\n",
"try :\n",
" while True :\n",
" print( ' ' * indent, end = '' )\n",
" print( '* * * * * * * *' )\n",
" time.sleep( 0.1 )\n",
" if indentIncreasing :\n",
" indent = indent + 1\n",
" if indent == 20 :\n",
" indentIncreasing = False\n",
" else :\n",
" indent = indent - 1\n",
" if indent == 20 :\n",
" indentIncreasing = True\n",
"except KeyboardInterrupt :\n",
" sys.exit()"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment