import random
import pgzrun

WIDTH, HEIGHT = 500, 500

teiler = 10

abstand = int(WIDTH / (teiler-1))
radius = random.randint(0, abstand)

def entscheide(wahrscheinlichkeit):
    return random.random() < wahrscheinlichkeit

def update():
    pass

def draw():
    global abstand, radius
    
    screen.fill("black")
    
    if entscheide(0.1):
        radius = random.randint(0, abstand)

    for x in range(0, WIDTH+1, abstand):
        for y in range(0, WIDTH+1, abstand):
            screen.draw.circle((x, y), radius, "white")
    

pgzrun.go( )
Zuletzt geändert: Donnerstag, 3. April 2025, 08:51