Skip to content

Instantly share code, notes, and snippets.

@thomhastings
Forked from phreeza/wedding.py
Last active July 2, 2016 16:44
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 thomhastings/fc8e8d34ee9083125d9144bb7d4743c5 to your computer and use it in GitHub Desktop.
Save thomhastings/fc8e8d34ee9083125d9144bb7d4743c5 to your computer and use it in GitHub Desktop.
A small terminal based animation I made for a friend's wedding
# This script is released 'as is' into the public domain
from math import cos,sin
import os
from time import sleep
def y(p):
return (sin(p)**3)
def x(p):
return -(13*cos(p)-5*cos(2*p)-2*cos(3*p)-cos(4*t))/16
while True:
for r in range(14):
os.system('clear')
c = [[' ' for n in range(30)] for m in range(30)]
for t in range(100*r):
p = 0.0628/r*t
c[int(r*x(p)+15)][int(r*y(p)+15)] = '#'
for n in c:
print ''.join(n)
sleep(0.1)
sleep(1)
msg = 'Nina and Charlie'.split(' ')
for n in range(3):
os.system('clear')
for m,a in enumerate(msg[n]):
c[14+2*n][15+m-len(msg[n])/2]=a
for n in c:
print ''.join(n)
sleep(0.4)
sleep(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment