Animate Shader Toy.
# on a 5 x 5 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): s = t u = s % 100 if u < 25 : if y == 0 and (x == (u)//5): return (x%3)+2 if 25 <= u < 50 : if x == 4 and (y == (u-25)//5): return (y%3)+2 if 50 <= u < 75 : if y == 4 and (x == (75-u)//5): return (x%3)+2 if 75 <= u < 100 : if x == 0 and (y == (100-u)//5): return (y%3)+2 return 0 def draw(x,y,t): s = t // 10 return (x+y+s) % 5
submit code
play
pause
(first submit code, then hit play)