asin-checkpoint.py 292 B

12345678910111213141516171819
  1. import math
  2. import time
  3. w = 80
  4. h = 20
  5. for x in range(w):
  6. d_x = x / 80.0 * 360
  7. r_x = math.radians(d_x)
  8. sin_y = math.sin(r_x)
  9. sin_y = sin_y + 1.0
  10. _y = sin_y / 2.0 * h
  11. i_y = int(_y)
  12. # print(f"{i_y},{x}")
  13. print(F"\033[{i_y};{x}H*", end="")
  14. # time.sleep(1)