Code: Select all
import os
import math
class box:
def clear(self):
os.system(\"clear\")
def count(self,a):
self.a=\" \"*int(round(math.cos(a)*50)+50) #controls horizontal offset
self.b=int(round(math.sin(a)*20)+20) #controls vertical offset
def box(self):
print self.a,\"____\\n\",self.a,\"[ ]\\n\",self.a,\"[__]\"#draws box & horizontal offset
def voffset(self):
b=0
while b<=self.b:
print
b+=1
go=box()
a=0
while a<40:#the number after the < sign controls the duration.
go.clear()
go.count(a)
go.voffset()
go.box()
a+=0.02 #lower the number the slower the speed.