Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- from time import sleep
- cha = '""--__'
- a = [cha]
- for i in range(1,40):
- a.append(' ')
- le = len(a)
- def pr(a):
- b = []
- a.reverse()
- b = list(a)
- a.reverse()
- print '[',
- for i in range(le):
- print a[i],
- print b[i],
- print ']'
- def nex(a):
- lo = a.index(cha)
- if lo == 0:
- a[0] = ' '
- a[randint(0,1)] = cha
- elif lo == le-1:
- a[le-1] = ' '
- a[randint(le-2,le-1)] = cha
- else:
- a[lo] = ' '
- a[randint(lo-1,lo+1)] = cha
- while True:
- pr(a)
- nex(a)
- sleep(0.01)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement