Created
May 8, 2013 14:27
-
-
Save floq-design/5540808 to your computer and use it in GitHub Desktop.
List maker using javascript to output to HTML.
This file contains 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
<!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