Posted by ds on Sun 27th May 03:46
download | new post
- <html>
- <script language=javascript type="text/javascript">
- hp = 10;
- for(i=001; i < 10; i++) {
- document.writeln("Level " + i + " HP = " + addCommas(Math.round(hp)) + "<BR>")
- hp = hp *1.125
- }
- for(i=10; i < 100; i++) {
- document.writeln("Level " + i + " HP = " + addCommas(Math.round(hp)) + "<BR>")
- hp = hp *1.125
- }
- for(i=100; i < 351; i++) {
- document.writeln("Level " + i + " HP = " + addCommas(Math.round(hp)) + "<BR>")
- hp = hp *1.125
- }
- function addCommas(nStr)
- {
- nStr += '';
- x = nStr.split('.');
- x1 = x[0];
- x2 = x.length > 1 ? '.' + x[1] : '';
- var rgx = /(\d+)(\d{3})/;
- while (rgx.test(x1)) {
- x1 = x1.replace(rgx, '$1' + ',' + '$2');
- }
- return x1 + x2;
- }
- </script>
- </html>
Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.