Advertisement
jackieradallhazik

Raphics2

Nov 24th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. from random import randint
  2. from time import sleep
  3. cha = '""--__'
  4. a = [cha]
  5.  
  6. for i in range(1,40):
  7.     a.append(' ')
  8. le = len(a)
  9. def pr(a):
  10.     b = []
  11.     a.reverse()
  12.     b = list(a)
  13.     a.reverse()
  14.     print '[',
  15.     for i in range(le):
  16.         print a[i],
  17.         print b[i],
  18.     print ']'
  19. def nex(a):
  20.     lo = a.index(cha)
  21.     if lo == 0:
  22.         a[0] = ' '
  23.         a[randint(0,1)] = cha
  24.     elif lo == le-1:
  25.         a[le-1] = ' '
  26.         a[randint(le-2,le-1)] = cha
  27.     else:
  28.         a[lo] = ' '
  29.         a[randint(lo-1,lo+1)] = cha
  30. while True:
  31.     pr(a)
  32.     nex(a) 
  33.     sleep(0.01)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement