1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// require https://cdn.jsdelivr.net/npm/p5@1.4.0/lib/p5.js
function setup() {
createCanvas(600, 600);
noLoop();
}
function draw() {
// draw the sky
noStroke();
fill(0, 0, 255);
rect(0, 0, 800, 600);
// draw the grass
fill(0, 255, 0);
rect(0, 400, 800, 200);
// draw the main part of the house
fill(255, 255, 0);
rect(200, 250, 200, 200);
// draw the roof
fill(255, 0, 0);
triangle(150, 250, 300, 100, 450, 250);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
⌥⌘j Open Console | ⌘s/ctrl-s Update Preview |