vague.py

Created by martin-garel-528

Created on February 23, 2025

354 Bytes

Script that draw waves to the screen, with various parameter to choose how they are rendered


from math import *
from kandinsky import *

def w(a, l, off=0):
  t = 0
  s = (1/l)*l/a
  while t < 2*pi:
    y = round(sin(t-off)*a)
    dx = t*l/(2*pi)
    for x in range(0, 320, l):
      set_pixel(x+round(dx),y+111,(0,0,0))
    t += s

t = 0
a = 10
l = 50
while True:
  w(a, l, t)
  fill_rect(0,111-a,320,a*2+1,(255,255,255))
  t += 0.15

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.