Source of: Bouncing Ball, by Grok 4.3
18 lines, no comments ยท 766 tokens, written in 8 seconds for $0.0022
1 let x = 200;
2 let y = 200;
3 let xspeed = 3;
4 let yspeed = 2;
5
6 function setup() {
7 createCanvas(400, 400);
8 }
9
10 function draw() {
11 background(220);
12 fill(255, 0, 0);
13 ellipse(x, y, 50, 50);
14 x += xspeed;
15 y += yspeed;
16 if (x > width || x < 0) xspeed *= -1;
17 if (y > height || y < 0) yspeed *= -1;
18 }