Skip to content

Instantly share code, notes, and snippets.

@floq-design
Created May 8, 2013 14:27
Show Gist options
  • Save floq-design/5540808 to your computer and use it in GitHub Desktop.
Save floq-design/5540808 to your computer and use it in GitHub Desktop.
List maker using javascript to output to HTML.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>List Maker</title>
<script>
var prefix = "bingo_", // prefix
extension = ".bmp", // file extension
suffix = " 9", // output suffix
countStart = 10, // start number
countEnd = 20, // end number
countPad = 4, // number of characters for count
countStep = 1; // count every..
paddedCount = function(_i){
_i = _i + '';
if (_i.length < countPad) {
padString = '';
for (p = 0; p < countPad - _i.length; p ++) {
padString += '0';
}
}
return padString + _i;
}
for (i = countStart; i <= countEnd; i += countStep) {
document.write( prefix + paddedCount(i) + extension + suffix + '<br>');
}
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment