Completed
Push — master ( c37b8d...0e5d6a )
by
unknown
30s queued 12s
created

example_011   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 3

2 Functions

Rating   Name   Duplication   Size   Complexity  
A pseudo_random() 0 2 1
A update() 0 16 2
1
from pypen import *
2
3
4
def pseudo_random(seed: float):
5
    return abs(sin(seed % 478562)*cos(seed % 3579))
6
7
def update():
8
    clear_screen()
9
10
    i = 0
11
    offset_y = TIME*170
12
13
    for x, y in grid(spacing=30):
14
        seed = i+x*y
15
16
        actual_y = (y + offset_y) % HEIGHT - 30
17
        percentage = (1-(actual_y/HEIGHT)**5)
18
        color = (80, 130, 50, pseudo_random(seed)*255*percentage)
19
20
        circle(x, actual_y, pseudo_random(seed)*14*percentage, color)
21
22
        i += 1
23