z_set_get_pixel.py

Created by cent20

Created on October 21, 2020

459 Bytes

Zero series: Start and learn to code in python on the NumWorks. A script, a demo. [EN]
Série zéro: Débuter et apprendre à coder en python sur la NumWorks. Un script, une démo. [FR]


from kandinsky import *
from time import sleep

def bij(r,g,b,y):
  fill_rect(1,y,42,42,(r,g,b))
  fill_rect(43,y,280,42,(255,255,255))
  draw_string("set_pixel =" + str((r,g,b)),50,y)
  draw_string("get_pixel =" + str(get_pixel(1,y)),50,y+20)
  
  
bij(120,121,122,1)
bij(80,80,80,41)
bij(44,44,44,81)
bij(255,255,255,121)

draw_string("     saut :   R=8, G=4, B=8",1,200)

for i in range(128):
  bij(0+i,64+i,128+i,161)
  sleep(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 cookies policy.