Last active
October 13, 2015 12:58
-
-
Save willread/4199560 to your computer and use it in GitHub Desktop.
Solve for number of columns, width of columns and padding given width
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var width = 620; | |
var minSize = 100; | |
var maxPadding = 10; | |
for(var padding = 1; padding < maxPadding; padding++){ | |
for(var size = minSize; size < width; size++){ | |
var cols = (width + padding) / (size + padding); | |
if(cols % 1 == 0) | |
console.log("columns: " + cols + " size: " + size + " padding: " + padding); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment