Skip to content

Instantly share code, notes, and snippets.

@martync
Forked from brunobord/ola.py
Created June 22, 2012 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martync/2971723 to your computer and use it in GitHub Desktop.
Save martync/2971723 to your computer and use it in GitHub Desktop.
Olà in Python / ASCII art
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import os
import time
def cls():
os.system(['clear', 'cls'][os.name == 'nt'])
figure_repos = '.o.'
figure_mid = '-o-'
figure_up = '\o/'
nb = 20
for i in xrange(nb):
cls()
figures = []
for j in xrange(nb):
if i == j:
figures.append(figure_up)
elif i == j-1 or i == j+1:
figures.append(figure_mid)
else:
figures.append(figure_repos)
print "".join(figures)
time.sleep(0.3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment