100x100 Computational Design Challenge

Throughout 2020 I created 100 computational designs in 100 days as a way to learn creative coding and explore generative art

Day 35 - Hedge Maze

hedge-maze-1.png

Building on the code from the last couple days. I’m not sure about this grid approach to pattern making as I’m finding some limitations, I also don’t know enough about how to manipulate it yet to get what I want! Still lots to learn, but I do like how this one turned out.

Sketch:

https://editor.p5js.org/chelseamwatson/present/AIZYjSY_k


Drawings:


Code:

var tileCount = 25;
var actRandomSeed = 0;

function setup() {
  createCanvas(700, 700);
  strokeCap(PROJECT);
}

function draw() {
  clear();
  randomSeed(actRandomSeed);
  background(209, 221, 220);
  for (var gridY = 0; gridY < tileCount; gridY++) {
    for (var gridX = 0; gridX < tileCount; gridX++) {

      var posX = width / tileCount * gridX;
      var posY = height / tileCount * gridY;

      var toggle = int(random(0, 2));

      if (toggle == 0) {

        stroke(58, 101, 84);
        strokeWeight(1);
        line(posX, posY, posX + width / tileCount, posY + height / tileCount);
      }

      if (toggle == 1) {

        stroke(255);
        strokeWeight(8);
        line(posX + 6, (posY + width / tileCount) + 6, (posX + height / tileCount) + 6, posY + 6);

        stroke(255, 209, 71);
        strokeWeight(2);
        line(posX + 3, (posY + width / tileCount) + 3, (posX + height / tileCount) + 3, posY + 3);

        stroke(58, 101, 84);
        strokeWeight(1);
        line(posX, posY + width / tileCount, posX + height / tileCount, posY);


      }
    }
  }
}

function mousePressed() {
  actRandomSeed = random(100000);
}

Chelsea Watson