Question

I am looking to have a script to output a large amount of sequential numbers (One million at a time) from a number that is 17 char's long. (EG 12345678912345678)

I essentially want it to work like this site (http://sequencegenerator.com) but use MY CPU and not his. His site locks up when I tell it to do a million and I tend to generate many millions at a time.

I found this script from online, but I dont know any VisualBasic so I am unsure how to make it work for me. I am in NO way preferential about the scripting language used as long as I can run it natively on Windows 7 =)

Set WSHShell = Wscript.CreateObject("WScript.Shell")       
Set FSO = Wscript.CreateObject("Scripting.FileSystemObject") 
Set EnvVar = wshShell.Environment("Process")
tBestand= EnvVar("USERPROFILE") & "\Desktop\HexNumbers.txt"
Set Bestand = fso.createtextfile(tBestand,1)
For x = 1486262272 To 1486461337
Bestand.WriteLine(hex(x))
Next
Bestand.close
WScript.quit
Was it helpful?

Solution

Here it is in javascript, but I have it just adding a thousand numbers by default. It takes forever to do a million.

<html>
<head>
<title>Number Generator</title>
<script type="text/javascript">
    function generateNumbers() {
        var startNum = parseInt(document.getElementById("startNum").value);
        var numsToAdd = parseInt(document.getElementById("numsToAdd").value);
        var output = document.getElementById("output");
        for (var num = startNum; num < startNum + numsToAdd; num++) {
            var divelem = document.createElement("div");
            divelem.innerHTML = num;
            output.appendChild(divelem);
        }
    }

    function clearNumbers() {
        var output = document.getElementById("output");
        output.innerHTML = "";
    }
</script>
</head>
<body>
Start Number: <input type="text" id="startNum" name="startNum" value="1486262272">
<input type="button" value="Run" onclick="generateNumbers()">
<input type="button" value="Clear" onclick="clearNumbers()">
<br>
Nums To Add: <input type="text" id="numsToAdd" name="numsToAdd" value="1000">
<div id="output"></div>
</body>

OTHER TIPS

Here it is in perl.

#!/usr/bin/perl

$num = $start_num = $ARGV[0];
if ($start_num eq "") {
    die "must pass in starting number\n";
}

while ($num < $start_num + 1000000) {
    print $num++."\n";
}

print "started with $start_num, ended with $num\n";

Just run it by passing in a number.

million.pl 12345678912345678
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top