Drunken Walk
to generate a new and unique variation
Every variart piece is open source, you can see exactly how it is drawn from the code.
var length = intVariable('length', 50, 200);
var stepMagnitude = intVariable('stepMagnitude', 10, 30);
var x = width/2;
var y = height/2;
var points = [];
for (var i = 0; i < length; i++){
var newX = x + getRandomInt(-stepMagnitude, stepMagnitude);
var newY = y + getRandomInt(-stepMagnitude, stepMagnitude);
points.push([x, y, newX, newY])
x = newX
y = newY
}
s.polyline(points).attr({fill: 'none', strokeWidth: 3, stroke: 'black'});
Copyright © 2014–2025 Kevin Marsh. All rights reserved. Questions? Comments? hello@variart.io