Skip to content

Instantly share code, notes, and snippets.

@phreeza
Last active July 2, 2016 16:43
Show Gist options
  • Select an option

  • Save phreeza/a120bc6ae42df1176231d46e105727f2 to your computer and use it in GitHub Desktop.

Select an option

Save phreeza/a120bc6ae42df1176231d46e105727f2 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 = 'Alice and Bob'.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)
@phreeza
Copy link
Copy Markdown
Author

phreeza commented Jun 1, 2016

@ligi
Copy link
Copy Markdown

ligi commented Jun 1, 2016

@phreeza
Copy link
Copy Markdown
Author

phreeza commented Jun 1, 2016

Haha amazing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment