From 73f04a63ffc0dd4c2956b6f455a93bb6d6f1fd14 Mon Sep 17 00:00:00 2001
From: Santo Cariotti <santo@dcariotti.me>
Date: Sat, 13 Feb 2021 01:43:58 +0100
Subject: i&m: moon exercise

---
 Year_2/IandM/moons/README.md         |   1 +
 Year_2/IandM/moons/image.jpg         | Bin 0 -> 8206 bytes
 Year_2/IandM/moons/moons.pde         |  14 ++++++++++++++
 Year_2/IandM/opacity_rect/alpha3.png | Bin 2372 -> 0 bytes
 Year_2/IandM/opacity_rect/image.jpg  | Bin 0 -> 2372 bytes
 5 files changed, 15 insertions(+)
 create mode 100644 Year_2/IandM/moons/README.md
 create mode 100644 Year_2/IandM/moons/image.jpg
 create mode 100644 Year_2/IandM/moons/moons.pde
 delete mode 100644 Year_2/IandM/opacity_rect/alpha3.png
 create mode 100644 Year_2/IandM/opacity_rect/image.jpg

(limited to 'Year_2/IandM')

diff --git a/Year_2/IandM/moons/README.md b/Year_2/IandM/moons/README.md
new file mode 100644
index 0000000..285ee03
--- /dev/null
+++ b/Year_2/IandM/moons/README.md
@@ -0,0 +1 @@
+![image](image.jpg)
diff --git a/Year_2/IandM/moons/image.jpg b/Year_2/IandM/moons/image.jpg
new file mode 100644
index 0000000..148e239
Binary files /dev/null and b/Year_2/IandM/moons/image.jpg differ
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;
+  }
+}
diff --git a/Year_2/IandM/opacity_rect/alpha3.png b/Year_2/IandM/opacity_rect/alpha3.png
deleted file mode 100644
index a15d029..0000000
Binary files a/Year_2/IandM/opacity_rect/alpha3.png and /dev/null differ
diff --git a/Year_2/IandM/opacity_rect/image.jpg b/Year_2/IandM/opacity_rect/image.jpg
new file mode 100644
index 0000000..a15d029
Binary files /dev/null and b/Year_2/IandM/opacity_rect/image.jpg differ
-- 
cgit v1.2.3-18-g5258