1234567891011121314151617181920212223 |
- import math
- import time
- w = 80
- h = 20
- for y in range(h):
- for x in range(w):
- d_x = x / 80.0 * 360
- r_x = math.radians(d_x)
-
- sin_y = math.sin(r_x)
- sin_y = sin_y + 1.0
-
- _y = sin_y / 2.0 * h
-
- i_y = int(_y)
-
- if y == i_y:
- print("*", end="")
- else:
- print(" ", end="")
- print()
- time.sleep(1)
|