Ce programme trace un échiquier vide: est-ce que quelqu’un saura y dessiner les pièces blanches et noires?
from kandinsky import * def segmentH(x1,x2,y): for i in range(x2-x1): set_pixel(x1+i,y,noir) def segmentV(x,y1,y2): for i in range(y2-y1): set_pixel(x,y1+i,noir) def carre(x,y,c): for i in range(20): for j in range(20): set_pixel(x+i,y+j,c) blanc=color(255,255,212)#ivoire brun=color(139,108,66)#chatain noir=color(0,0,0) L=['A','B','C','D','E','F','G','H'] for i in range(8): draw_string(L[i],85+i*20,15) draw_string(str(8-i),70,32+i*20) for j in range(8): if i%2==j%2:col=blanc else:col=brun carre(80+i*20,30+j*20,col) for i in range(9): segmentH(80,240,30+i*20) segmentV(80+i*20,30,190) set_pixel(240,190,noir)#dernier pt