BloomCode & Artishok
BloomCode BloomCode
Hey Artishok, I’ve been thinking about blending code and nature—like creating a generative garden that evolves in real time. Maybe we could experiment with algorithms that draw plants in abstract, vibrant ways. What do you think?
Artishok Artishok
Oh, a garden that blooms on a screen, darling! Imagine vines coded like splashes of neon, roots twining in random algorithms, leaves that change color with the beat of your heart—yes! Let the code be the brush, the plants the canvas, and chaos the muse. Throw in a little randomness, a dash of recursion, and watch the garden paint itself. Let’s paint the world with data and petals!
BloomCode BloomCode
That sounds like a perfect blend of code and nature—like a living brushstroke. I can imagine a recursive function that grows branches, each leaf sampling a color palette that shifts with the mouse or audio input. Maybe we add a tiny random seed to keep every run unique. Let’s sketch the algorithm and let the garden grow on the screen.
Artishok Artishok
Absolutely! Let the code be the pulse, the mouse the breath, and the audio the wind—each seed a tiny spark that unfolds into a riot of color and form. Ready to watch the garden paint itself? let's code it!
BloomCode BloomCode
Ready to pull up the canvas and let the vines start growing. Let's get the code humming and watch the garden bloom.
Artishok Artishok
Brilliant, the canvas is our empty field—let the vines sprout like thoughts in a storm, each leaf a splash of wild hue, every line a whispered secret. Turn the code on, let the garden breathe, and watch it paint itself in living color. Let the wildness begin!
BloomCode BloomCode
Here’s a quick p5.js start—feel free to tweak it: ```javascript let vines = []; function setup() { createCanvas(windowWidth, windowHeight); background(20); noStroke(); // seed a few initial vines for (let i = 0; i < 3; i++) { vines.push(new Vine(width/2 + random(-100,100), height)); } } function draw() { background(20, 20, 20, 10); // gentle fade for (let v of vines) { v.update(); v.display(); } } class Vine { constructor(x, y) { this.points = [{x: x, y: y}]; this.col = color(random(50,200), random(50,200), random(50,200), 150); } update() { // grow one new point each frame let last = this.points[this.points.length-1]; let angle = noise(last.x * 0.01, last.y * 0.01, frameCount * 0.02) * TWO_PI; let len = 5 + sin(frameCount * 0.1) * 3; let nx = last.x + cos(angle) * len; let ny = last.y + sin(angle) * len; this.points.push({x: nx, y: ny}); // keep length reasonable if (this.points.length > 200) this.points.shift(); } display() { stroke(this.col); strokeWeight(2); beginShape(); for (let p of this.points) vertex(p.x, p.y); endShape(); // add a leaf let p = this.points[this.points.length-1]; push(); translate(p.x, p.y); rotate(atan2(p.y - this.points[this.points.length-2].y, p.x - this.points[this.points.length-2].x)); fill(this.col); noStroke(); ellipse(0, 0, random(5,15), random(3,8)); pop(); } } function mousePressed() { vines.push(new Vine(mouseX, mouseY)); } function keyPressed() { if (key === 'c' || key === 'C') background(20); } ``` Run it in the p5 editor or any HTML file with p5.js linked, and watch the garden unfold as you move the mouse or press keys. Happy coding!