Sign in to follow this  
Followers 0
z0mgItsJohn

Can A Script Tell Me All Possible Combinations.. From 0000 To 9999

5 posts in this topic

Eh The Title Really Doesn't Explain My Question Well.. So Here's What I'm Trying To Ask.. Can I Make A Script To Give Me All The "Numbers" From 0000 To 9999 I.E. :

0000

0001

0002

0003

0004

0005

0006

0007

0008

0009

-----

0010

0011

0012

0013

0014

0015

0016

0017

0018

0019

-----

0020

0021

0023

0024

0025

0026

0027

0028

0029

-----

.... 9999 Get What I'm Trying To Ask.. I Hope Someone Can Help Me.. Or Give Me An Example Script That Can Do This D:


Latest Projects :- New & Improved TCP Chat

Share this post


Link to post
Share on other sites



Eh The Title Really Doesn't Explain My Question Well.. So Here's What I'm Trying To Ask.. Can I Make A Script To Give Me All The "Numbers" From 0000 To 9999 I.E. :

0000

0001

0002

0003

0004

0005

0006

0007

0008

0009

-----

0010

0011

0012

0013

0014

0015

0016

0017

0018

0019

-----

0020

0021

0023

0024

0025

0026

0027

0028

0029

-----

.... 9999 Get What I'm Trying To Ask.. I Hope Someone Can Help Me.. Or Give Me An Example Script That Can Do This D:

What type of output are you trying to generate? Text? Variable numbers for future Array use?


My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

Share this post


Link to post
Share on other sites

try

for $i = 1 to 9999

ConsoleWrite(StringFormat("%04i",$i) & @CRLF)

if mod($i,10) = 0 then ConsoleWrite("----" & @CRLF)

Next

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

_genNum(0,9999)

Func _genNum($start,$end)
    $numberfile = FileOpen("C:\temp\numbers.txt",1)
    For $i = $start to $end Step 1
        Select
            Case $i <= 9
                FileWrite($numberfile,"00" & $i & @CRLF)
            Case $i >= 10 And $i <= 99
                FileWrite($numberfile,"00" & $i & @CRLF)
            Case $i >= 100 And $i <= 999
                FileWrite($numberfile,"0" & $i & @CRLF)
            Case $i > 999
                FileWrite($numberfile,$i & @CRLF)
        EndSelect
    Next
    FileClose($numberfile)
    MsgBox(0,"Numbers Generated","Numbers were successfully generated.")
EndFunc

Change _genNum(0,9999) to whatever start/end values you want.

Enjoy.

Edited by Ealric

My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

Share this post


Link to post
Share on other sites

try

for $i = 1 to 9999

ConsoleWrite(StringFormat("%04i",$i) & @CRLF)

if mod($i,10) = 0 then ConsoleWrite("----" & @CRLF)

Next

Wow.. Thanks ^^; It Worked Like A Charm.. ^^;


Latest Projects :- New & Improved TCP Chat

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0