sasas.py

Created by wperez274

Created on September 25, 2023

603 Bytes


from ion import *
import kandinsky as kd

my_list = []
seen_coordinates = set()
x, y = 160, 120
max_len = 200
count = 0

while not keydown(KEY_EXE):
    kd.fill_rect(x, y, 5, 5, (0, 0, 0))
    
    if count < max_len:
        coordinate = (x, y)
        if coordinate not in seen_coordinates:
            my_list.append(coordinate)
            seen_coordinates.add(coordinate)
            count += 1
    
    if keydown(KEY_LEFT):
        x -= 5
    elif keydown(KEY_RIGHT):
        x += 5
    elif keydown(KEY_UP):
        y -= 5
    elif keydown(KEY_DOWN):
        y += 5

print(my_list)

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.