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)

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 <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.