dvd.py

Created by elnix91

Created on October 11, 2025

954 Bytes

The DVD icon, at least i was that, now it’s just a strange simulation on pixels


from kandinsky import draw_string as d, fill_rect as rect,set_pixel as p
from random import randint as r,choice as ch
from ion import keydown as k
import time

h=320
w=222


while 1:
  rect(0,0,320,222,(0,0,0))

  x,y=r(0,h),r(0,w)
  start_x,start_y=x,y
  #x,y=1,0

  incr_x=ch([-1,1])
  incr_y=ch([-1,1])
  start_ix,start_iy=incr_x,incr_y
  c=(255,)*3

  x+=incr_x
  y+=incr_y
  while (
not (x==start_x and y==start_y and
start_ix==incr_x and start_iy==incr_y)
):
    x_i,y_i=0,0
  
    x+=incr_x
    y+=incr_y

#    c=(r(0,255),r(0,255),r(0,255))

    if x==0 or x==h:
      incr_x=-incr_x
      x_i = 1

    if y==0 or y==w:
      incr_y=-incr_y
      y_i = 1
  
    if x_i and y_i:
      rect(x-5,y-5,10,10,(255,0,0))
      rect(135,86,50,50,(255,0,0))
      while not k(4):1
      break
#    if k(4):break
    
#  d("DVD",x,y)
#    p(x,y,(255,255,255))
    p(x,y,c)


  rect(135,86,50,50,(0,255,0))
  while not k(4):1
#  time.sleep(0.05)

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.