Advertisement
Guest User

Donut

a guest
May 22nd, 2021
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.99 KB | None | 0 0
  1. import os
  2. import sys
  3. import math
  4.  
  5. WIDTH = 30
  6. HEIGHT = 15
  7.  
  8. A = 0
  9. B = 0
  10. S = [46, 44, 45, 126, 58, 59, 61, 33, 42, 35, 36, 64]
  11. while True:
  12.     b = [32] * 1760
  13.     z = [0] * 1760
  14.     j = 0
  15.     while j < 6.28:
  16.         i = 0;
  17.         while i < 6.28:
  18.             c = math.sin(i)
  19.             l = math.cos(i)
  20.             f = math.sin(j)
  21.             d = math.cos(j)
  22.             e = math.sin(A)
  23.             g = math.cos(A)
  24.             n = math.sin(B)
  25.             m = math.cos(B)
  26.             h = c * (d + 2)
  27.             q = l * (d + 2)
  28.             t = h * g - f * e
  29.             D = 1 / (h * e + f * g + 5)
  30.             o = int(1000 + WIDTH * D * (q * m - t * n) + 80 * int(HEIGHT * D * (q * n + t * m)))
  31.             if 1760 > o and D > z[o]:
  32.                 z[o] = D
  33.                 r = c * d
  34.                 N = int(8 * ((f * e - r * g) * m - r * e - f * g - l * d * n))
  35.                 if N < 0:
  36.                     N = 0
  37.                    
  38.                 b[o] = S[N]
  39.                
  40.             i += 0.02
  41.  
  42.         j += 0.07
  43.  
  44.     os.system('clear')
  45.     o = 0
  46.     while o < 1761:
  47.         if o % 80 == 0:
  48.             p = chr(10)
  49.         else:
  50.             p = chr(b[o])
  51.         sys.stdout.write(p)
  52.         sys.stdout.flush()
  53.         o += 1
  54.  
  55.     A += 0.04
  56.     B += 0.02
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement