walk1.py

Created by schraf

Created on August 29, 2022

363 Bytes

L’idée m’est venue en regardant la vidéo de Nicolas Decoster - Art génératif avec adacraft - JAIME 2022


import turtle
from random import randint
from time import monotonic
from kandinsky import fill_rect

t = turtle

fill_rect(0,0,320,222,(0,0,0))

while True:
  (x, y) = t.position()
  g = (10 * monotonic()) % 255
  t.color(g,g,0)
  if abs(x) > 159 or abs(y) > 110:
    t.penup()
    t.goto(0,0)
    t.pendown()
  t.setheading(randint(0,359))
  t.fd(1)