summaryrefslogtreecommitdiff
path: root/Year_2/IandM/moons/moons.pde
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-02-13 01:43:58 +0100
committerSanto Cariotti <santo@dcariotti.me>2021-02-13 01:43:58 +0100
commit73f04a63ffc0dd4c2956b6f455a93bb6d6f1fd14 (patch)
tree5120d4985b1c8e551e6ec9b16215ad258a655627 /Year_2/IandM/moons/moons.pde
parent2398d4170d50f0fecbf6774a36f1e7c1a9b2e685 (diff)
i&m: moon exercise
Diffstat (limited to 'Year_2/IandM/moons/moons.pde')
-rw-r--r--Year_2/IandM/moons/moons.pde14
1 files changed, 14 insertions, 0 deletions
diff --git a/Year_2/IandM/moons/moons.pde b/Year_2/IandM/moons/moons.pde
new file mode 100644
index 0000000..7fe6efa
--- /dev/null
+++ b/Year_2/IandM/moons/moons.pde
@@ -0,0 +1,14 @@
+size(500, 500);
+background(255);
+noStroke();
+fill(0);
+
+int k = 0;
+for(int y = 0; y < width; y+=50) {
+ k = (int)lerp(0, 255, y);
+ for(int x = 0; x < height; x+=50) {
+ fill(k);
+ rect(x, y, 50, 50);
+ k+=5;
+ }
+}