Ca semble corriger pas mal de choses reportées

critor wrote:Le pire étant que plus j'en teste, et plus je trouve de choses à dire.
critor wrote:J'atteins 15,6 Mo de heap Python avec une mémoire à peu près vide, de quoi coder et exécuter de formidables projets !
J'en connais qui peuvent aller se rhabiller...
critor wrote:J'en connais qui peuvent aller se rhabiller...
from polycalc import *
screen_w, screen_h, my_draw_line, my_fill_rect, my_show_screen, test_esc_key = get_infos(("w", "h", "dl", "fr", "sh", "ek"))
def demog(n=64, front_color=(255, 0, 255)):
n_max = 256
n = min(n_max, n)
dx = n_max // n
dy = dx
def get_dir(x, y, d):
if(x >= screen_w - 1 and y <= 0):
d = [0, dy]
elif(x >= screen_w - 1 and y >= screen_h - 1):
d = [-dx, 0]
elif(x <= 0 and y >= screen_h - 1):
d = [0, -dy]
elif(x <= 0 and y <= 0):
d = [dx, 0]
return d
x1, y1 = 0, 0
x2, y2 = screen_w - 1, 0
d1 = [dx, 0]
d2 = [0, dy]
colors = [ tuple([(255 - front_color[j]) * (n - 1 - i) // (n - 1) + front_color[j] for j in range(3)]) for i in range(n)]
l = [[0,0,0,0] for k in range(n)]
my_fill_rect(0, 0, screen_w, screen_h, (255, 255, 255))
while not test_esc_key():
x1 += d1[0]
y1 += d1[1]
x2 += d2[0]
y2 += d2[1]
l.append((x1, y1, x2, y2))
for k in range(n):
c = l[k]
my_draw_line(c[0], c[1], c[2], c[3], colors[k])
l.pop(0)
my_show_screen()
d1 = get_dir(x1, y1, d1)
d2 = get_dir(x2, y2, d2)
demog()
Users browsing this forum: ClaudeBot [spider] and 2 guests