npm.io
1.0.1 • Published 11 years ago

sacados

Licence
MIT
Version
1.0.1
Deps
0
Vulns
0
Weekly
0

backpack

A node module to pack boxes into a 2D space

Example:

var BackPack = require("sacados");

var boxes = [];
for(var i = 0; i<20; i++){
    var width = Math.floor(Math.random() * (20 - 5 + 1)) + 5;
    var height = Math.floor(Math.random() * (20 - 5 + 1)) + 5;
    boxes.push({'id': i, 'width': width, 'height': height});
}

backPack = new BackPack(40, 10000);