GNU/Linux ◆ xterm-256color ◆ bash 1881 views

import time

  import numpy as np

  def asci_flower(char='O', n1=15, n2=15, inner=5, outter=15):
      S = ''
      for i in range(outter*2):
          for j in range(outter*4):
              x,y = i-outter,(j-outter*2)/2
              angle = np.arctan2(x,y)
              Z = min((angle*n1/np.pi)%2., (-angle*n2/np.pi)%2.)
              r = np.sqrt(x**2 + y**2)
              if r-inner < Z*(outter - inner):
                  S += char
              else:
                  S += ' '
          S += '\n'
      return S

  for x in range(1,30):
      print(asci_flower(n1=x, n2=x))
      time.sleep(2)