sign.py

Created by schraf

Created on January 15, 2023

628 Bytes


from kandinsky import *
from math import sin,cos
from random import *
from time import monotonic

fill_rect(0,0,320,222,(0,0,0))
COUL = (0,0,0),(248,0,0),(248,252,0),(248,252,248)

def s(n): return n>.05

while True:
  r=monotonic()/10
  for i in range(65):
    for j in range(45):
      if random()<.2:
        x,y=5*i,5*j
        e=x/120-cos(r)/4-.5
        f=y/120-sin(r)/4-1.3
        j=cos(2*r)*e-sin(r)*f/2-.3
        k=sin(r)*e/2+cos(2*r)*f+.5 
        n=s(j); m=s(k); n*=s(1-j); m*=s(1-k)
        c1=COUL.index(get_pixel(x,y))
        c2=max(0,min(3,n*m*2+c1-1))
        if c1!=c2:fill_rect(x,y,4,4,COUL[c2])

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.