Created
July 16, 2021 13:47
-
-
Save morgulbrut/62662877a5acaef815801279e8c05b9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup() { | |
createCanvas(6400, 4800) | |
background(0) | |
colorMode(HSB, 360, 100, 100) | |
frameRate(1200); | |
} | |
function draw() { | |
let x = 0 | |
let y = 0 | |
for (let i = 0; i < 1000000; i++) { | |
p = random([0,1,2]) | |
if (p == 0){ | |
x /= 2 | |
y = (y + 4800)/2 | |
} | |
else if (p == 1){ | |
x = (x + 3200)/2 | |
y /= 2 | |
} | |
else{ | |
x = (x + 6400)/2 | |
y = (y + 4800)/2 | |
} | |
stroke(i%360, 100, 100) | |
point(x, y) | |
} | |
noLoop() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
copy it into the p5.js online editor and run it.