Skip to content

Commit

Permalink
JAN17 + tweak to JAN16
Browse files Browse the repository at this point in the history
  • Loading branch information
ronikaufman committed Jan 17, 2023
1 parent b011b37 commit dfc16f6
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 2 deletions.
1 change: 0 additions & 1 deletion JAN11-20/JAN16/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ By Roni Kaufman
https://ronikaufman.github.io
*/

let myFont;
let s = 5;
let N_FRAMES = 360;

Expand Down
Binary file added JAN11-20/JAN17/JAN17_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JAN11-20/JAN17/JAN17_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JAN11-20/JAN17/JAN17_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions JAN11-20/JAN17/sketch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
Genuary 2023
JAN.17 "A grid inside a grid inside a grid"
By Roni Kaufman
https://ronikaufman.github.io
*/

let s = 20, probFactor;

function setup() {
createCanvas(33*s, 33*s);
noStroke();
textSize(s*0.7);
textAlign(CENTER, CENTER);
noLoop();
probFactor = random(1/2, 3/4);
}

function draw() {
background("#050505");
makeCompo(s, s, width-2*s, height-2*s, 4, 1);
}

function makeCompo(x, y, w, h, n, prob) {
if (n == 0 || random() > prob) {
let c = random(["🟦", "🟥", "🟨", "⬜"]);
for (let x1 = x; x1 < x+w; x1 += s) {
for (let y1 = y; y1 < y+h; y1 += s) {
push();
translate(x1+s/2, y1+s/2);
rotate(random(TAU));
text(c, 0, 0);
pop();
}
}
return;
}
let wHalf = (w-s)/2, hHalf = (h-s)/2, newProb = prob*probFactor;
makeCompo(x, y, wHalf, hHalf, n-1, newProb);
makeCompo(x+wHalf+s, y, wHalf, hHalf, n-1, newProb);
makeCompo(x, y+hHalf+s, wHalf, hHalf, n-1, newProb);
makeCompo(x+wHalf+s, y+hHalf+s, wHalf, hHalf, n-1, newProb);
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ Reference: ["Wanderer (rotations)" on the Tilings Encyclopedia](https://tilings.
### JAN. 17
> A grid inside a grid inside a grid
<img src="./JAN11-20/JAN17/JAN17_1.png" width="30%"/> <img src="./JAN11-20/JAN17/JAN17_2.png" width="30%"/> <img src="./JAN11-20/JAN17/JAN17_3.png" width="30%"/>

### JAN. 18
> Definitely not a grid
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html>
<head>
<script src="./p5.min.js" type="text/javascript"></script>
<script src="JAN11-20/JAN16/sketch.js" type="text/javascript"></script>
<script src="JAN11-20/JAN17/sketch.js" type="text/javascript"></script>
</head>
<body style = "width: 100%; height: 100%; background-color: 0; margin: 0; display: flex; justify-content: center; align-items: center;">
</body>
Expand Down

0 comments on commit dfc16f6

Please sign in to comment.