SketchBook

var angle;

function setup() {
createCanvas(windowWidth,
windowHeight);
angleMode(DEGREES);
angle = 30;
background(250, 100, 0);
stroke(20, 20, 20);
translate(width / 2, height);
branch(height / 4);
}

function draw() {
}

function branch(L) {
 angle = random(25, 40);
var angle;

function setup() {
createCanvas(windowWidth,
windowHeight);
angleMode(DEGREES);
angle = 30;
background(250, 100, 0);
stroke(20, 20, 20);
translate(width / 2, height);
branch(height / 4);
}

function draw() {
}

function branch(L) {
 angle = random(25, 40);
var angle;

function setup() {
createCanvas(windowWidth,
windowHeight);
angleMode(DEGREES);
angle = 30;
background(250, 100, 0);
stroke(20, 20, 20);
translate(width / 2, height);
branch(height / 4);
}

function draw() {
}

function branch(L) {
angle = random(25, 40);
var w = map(L, 0, width / 4, 1, 20);
strokeWeight(w);
line(0, 0, 0, -L);
translate(0, -L);
if (L > 5) {
push();
rotate(angle);
branch(L * 0.7);
pop();
push();
rotate(-angle);
branch(L * 0.7);
pop();
}
}

var w = map(L, 0, width / 4, 1, 20);
strokeWeight(w);
line(0, 0, 0, -L);
translate(0, -L);
if (L > 5) {
push();
rotate(angle);
branch(L * 0.7);
pop();
push();
rotate(-angle);
branch(L * 0.7);
pop();
}
}

var w = map(L, 0, width / 4, 1, 20);
strokeWeight(w);
line(0, 0, 0, -L);
translate(0, -L);
if (L > 5) {
push();
   rotate(angle);
   branch(L * 0.7);
pop();
push();
rotate(-angle);
branch(L * 0.7);
pop();
}
}