Skip to content

Instantly share code, notes, and snippets.

@cutty853
cutty853 / tiler.js
Last active February 19, 2019 22:09
Algorithm to tile an array. Written in NodeJS
/**
* Produce a list of list by tiling the originalArray.
*
* @param {int} tileAmount amount of tiles per ligne
* @param {Array} originalArray the array to tile
*/
function tiler(tileAmount, originalArray) {
tiles = [];
for (let index = 0; index < originalArray.length; index++) {