first_paint.py

Created by mobluse

Created on June 02, 2024

347 Bytes

A paint program. Press the arrow keys to move the painting cursor. Quit by pressing the back key twice. This works in the version compiled from GitHub, and probably the next release.


# First Paint
from ion import *
from kandinsky import *
import time
def first_paint():
  x=160
  y=100
  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
    set_pixel(x,y,color(0,255,0))
    time.sleep(0.1)
first_paint()

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>.