Rendu de travail

Exercice 1

size(400, 400);
line(400,400,0,0);
line(0,400,400,0);
line(160,320,240,320);
line(160,80,240,80);
line(240,200,320,200);
line(80,200,160,200);

Exercice 2

size(400, 400);
size(400, 400);

void setup()
{ frameRate (1);}

void draw()
{ background(random(400),[...],[...]);
line(random(400),[...],[...],[...]);}

Exercice 3

size(400, 400);
void setup(){
frameRate(4); }

void draw()
{stroke(255,255,255);
strokeWeight(10);
background(0,0,0);
point(random(400),random(400));
stroke(255,0,0);
line(200,200,random(400),[...]); }

Exercice 4

float x = 50;
void setup()
{ size(400, 400); }

void draw()
{background(#C0E1EA);
stroke(#FFBC03);
fill(#B6FF00);
ellipse(x, 20, 40, 40);
x = x + 1; }

void reset()
{ background(black);
x = 50; }

Exercice 5

float r = 1;
float circle_size = 40;

void setup()
{ size(400, 400);
background(0, 0, 0);
smooth();
noStroke();}

void draw()
{ fill(255);
rotate(r);
float circle_size = random(10, 10);
ellipse(10 + r, 10, circle_size, circle_size);
r = r + 1;
println(r); }

Commandes utilisées

point(x,y)
lign(x,y,x2,y2)
float r = X
void setup() { }
size(X,Y)
background(X)
smooth()
noStroke()
void draw() { }
fill(255)
rotate(r)
float circle_size = random(X,Y)
ellipse(X + r, 10, circle_size, circle_size)
r = r + X
println(r)
Ce site a été fait par Arnaud#8583
Back to top