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)