Skip to content

Instantly share code, notes, and snippets.

@morgulbrut
Created July 16, 2021 13:47
Show Gist options
  • Save morgulbrut/62662877a5acaef815801279e8c05b9b to your computer and use it in GitHub Desktop.
Save morgulbrut/62662877a5acaef815801279e8c05b9b to your computer and use it in GitHub Desktop.
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()
}
@morgulbrut
Copy link
Author

copy it into the p5.js online editor and run it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment