1.0.2 • Published 9 years ago

backpacking v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
9 years ago

backpack

A node module to pack boxes into a 2D space.

Installation

  npm install backpacking --save

Usage

  var BackPack = require("backpacking");
  
  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);

Tests

   npm test