Larger Animate Shader Toy.
# on a 40 x 40 grid # define a draw(x,y) function that # returns the color at x,y # colors: 0 = black, 1 = white, 2 = red, 3 = green, 4 = blue # and a global time variable t that tics up 1/10th of a second def draw(x,y,t): import math import random s = t // 5 u = s % 5 if y < 5 * math.sin(s + x/18)+7: return (x+u) %5 if y > 5 * math.sin(s - x/18) +33: return (y+x+u) %5 if 10 < (x-20 + 5 *math.cos(u))**2 + (y-20 + 5 *math.sin(u))**2 < 20: return 1 r = random.random() if r < 0.05: return 1 return 0
submit code
play
pause
(first submit code, then hit play)