Every possible 3 digit combination generator

  • Thread starter Thread starter D
  • Start date Start date
D

D

Hello everyone -
I'm trying to compile an application to generate all possible 3
digit combinations using 0-9 and a-z, I've looked everywhere for a
solution and I found Combinations! v 2.0 for windows, but I was more
looking to implement my own solution rather than buy software to
perform a small task. Thanks!
 
D said:
Hello everyone -
I'm trying to compile an application to generate all possible 3
digit combinations using 0-9 and a-z, I've looked everywhere for a
solution and I found Combinations! v 2.0 for windows, but I was more
looking to implement my own solution rather than buy software to
perform a small task. Thanks!

Personally, I'd just nest three for/next loops and go through the ascii
values for 0-9 and when I hit 9, jump up to the ascii code for a. But I
doubt that's the right answer.

I bounced it off someone else, and he said he'd probably build an array of
the 36 elements and use that for the loops.

This honestly sounds like a homework assignment so I don't really feel
comfortable giving you actual code to do it.

Both of the solutions above would work, but I have no idea what the 'right'
answer (or method) would be. Personally, I've always been a bigger fan of
'It works' than of 'I did it the right way.'
 
Hello everyone -
I'm trying to compile an application to generate all possible 3
digit combinations using 0-9 and a-z, I've looked everywhere for a
solution and I found Combinations! v 2.0 for windows, but I was more
looking to implement my own solution rather than buy software to
perform a small task. Thanks!

Shouldn't be too hard...
You'll need 3 nested loops:
Outer loop: changes the leftmost character
Middle loop: changes the middle character to every allowable digit for
each iteration of the Outer loop
Inner loop: changes the right character to every allowable digit
foreach iteration of the Middle loop.

pseudocode:

foreach left_character in [0-9a-z]
foreach middle_character in [0-9a-z]
foreach right_character in [0-9a-z]
print left_character,middle_character,right_character
endloop
endloop
endloop

I haven't actually tried proving this will work, but it looks pretty
close.
 
I can see how this could be very useful. One might wonder hmm is "2b9" a
valid 3-position alpha-numeric combination and then they could run the
program and keep an eye out for it. Or one might ask "how many gazillions of
combinations must that be" and now they could just run the program and count
them.

You might show us the code you have so far...
 
I can see how this could be very useful. One might wonder hmm is "2b9" a
valid 3-position alpha-numeric combination and then they could run the
program and keep an eye out for it. Or one might ask "how many gazillions of
combinations must that be" and now they could just run the program and count
them.

You might show us the code you have so far...

Well, if you just wanted to see if "2b9" was a "valid 3-position
alpha-numeric combination" then you could just use a pattern match,
maybe something like:
/[0-9a-z]{3}/
 
I can see how this could be very useful. One might wonder hmm is "2b9" a
valid 3-position alpha-numeric combination and then they could run the
program and keep an eye out for it. Or one might ask "how many gazillions of
combinations must that be" and now they could just run the program and count
them.

You might show us the code you have so far...

....and if he just wanted to know how many combinations there are, it
would be a calculation of... umm... ok I forget how to do that one. ;)

But surely he must have a good reason for needing every possible
[0-9a-z]{3} string!!
 
Actually that determines if the value matched the pattern not if it is a
member of the set generated by the program. Yes they happen to intersect
but a proof of one is not proof of the other unless you prove the two
methods always intersect.

In any case my reply was tongue-in-cheek, what Earthly use could a printout
of all 3-position alpha-numeric strings be?


I can see how this could be very useful. One might wonder hmm is "2b9" a
valid 3-position alpha-numeric combination and then they could run the
program and keep an eye out for it. Or one might ask "how many gazillions
of
combinations must that be" and now they could just run the program and
count
them.

You might show us the code you have so far...

Well, if you just wanted to see if "2b9" was a "valid 3-position
alpha-numeric combination" then you could just use a pattern match,
maybe something like:
/[0-9a-z]{3}/
 
In any case my reply was tongue-in-cheek, what Earthly use could a
printout of all 3-position alpha-numeric strings be?

Could be used to check all available 3 digit domain names?
 
Just to be clear with everyone...this absolutely is not a homework
assignemnt :( what I actually need this for.....I work for a large
company that handles about 30,000 inbound contacts per day. As our
products improve/increase we are highering more and more staff. Our
current staff of approx 412 customer representatives (for our region)
handle 20 different areas on the east coast. Each area has a unique
set of codes, etc. that are used to identify products. Since we merged
multiple companies together these 3-digit combinations (which we use
as our Operator IDs) are appearing as duplicates...we are looking for
all possible 3-digit combinations to set up 100% unique Operator IDs
and maintain a database of those that are available in each "corp" or
area (of the 20 corps). I found various solutions out on the internet
regarding codes but nothing that I found useful, or correct is what I
should say. I did however find software for $20 - that seemed
reasonable for what I need this for, that produces the results I was
seeking. I appreciate everyone's responses, even those that appear to
be insulting, this has helped me to better understand what is
producing these results and I have noted this for future reference.
Thanks again everyone!
 
Back
Top