A paint program. Press the arrow keys to move the painting cursor. Hold down SHIFT to paint faster. Press EXE/Enter to invert the screen. Press BACK/Esc key twice to quit.
# First Paint from ion import * from kandinsky import * import time def first_paint(): fill_rect(0,0,320,221,(137,127,117)) x=160 y=110 while 1: if keydown(KEY_LEFT): x-=1 if keydown(KEY_UP): y-=1 if keydown(KEY_RIGHT): x+=1 if keydown(KEY_DOWN): y+=1 if keydown(KEY_EXE): for j in range(221): for i in range(320): c=get_pixel(i,j) set_pixel(i,j,(255-c[0],255-c[1],255-c[2])) set_pixel(x,y,(0,255,0)) if keydown(KEY_SHIFT): dt=0.01 else: dt=0.1 time.sleep(dt) first_paint()