Skip to content

Instantly share code, notes, and snippets.

@cisoun
Created February 15, 2019 14:53
Show Gist options
  • Save cisoun/2f775c23f9e068e2afb8fc1c9e5e7e74 to your computer and use it in GitHub Desktop.
Save cisoun/2f775c23f9e068e2afb8fc1c9e5e7e74 to your computer and use it in GitHub Desktop.
Stupid blocks console animation made in Python
import sys
from time import sleep
if __name__ == "__main__":
i = 0
x = 0
d = 1
print('\033[36m')
while 1:
sys.stdout.write(chr(8) * 80)
for j in range(0, 80):
sys.stdout.write('█' if j % 8 == i else " ")
sys.stdout.flush()
i += d
if i >= 8:
i = 0
elif i < 0:
i = 7
sleep(1 / 30)
x += 1
if x >= 10:
x = 0
d = -1 * d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment