# ceci est un commentaire # importation des Shape a utiliser import java.awt.Rectangle; #par defaut color('blue'); #la couleur est bleue position(0,0); # la position est (0,0) rotate(0.0); # la rotation est 0.0 scale(1.0,1.0); # le scale est 1.0 define colorPosition(colorString c,int x,int y){ color(c); position(x,y); } define specialColor(int i,double a){ color(10*i,10*i,20*i,a); } int N = 10; Shape x= Rectangle(10,50); Shape y=Rectangle(50,10); Shape t[N]; for i: t[i] = Rectangle(10*(i + 1),20); at 0%: x{} # x a toutes les proprietes par defaut y{ color('red'); # on met y en rouge } at 25%: x{colorPosition('red',200,100);} # y n est pas specifie # ca veut dire qu'il a les meme proprietes que au temps precedent for i: t[i] {color(10*i,10*i,10*i);} } at 50%: y {colorPosition('red',400,100);} x{ colorPosition('yellow',200,100); rotate(0.55); # rotation de 0.55 rad } at 75%: y{position(100,400);} x{colorPosition('black',100,150); rotate(90d); # rotation de 90 degres } for i: t[i] {specialColor(i,i/N);position(10*i,10*i);} at 100%: x{scale(2.0,2.0);rotate(2.0);} y{color(red);}