What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Combonation Outputter ?

Combonation Outputter ?
Author: Message:
banky
Senior Member
****

Avatar
Fwee

Posts: 546
Reputation: 19
34 / Male / –
Joined: May 2004
O.P. Combonation Outputter ?
I was wondering if anyone knew of a combonation outputter or could make one that would put out all possible 5 digit combonations of the numbers 0 to 9.

Example :
12345
54321
99821

etc. Put only a program that could do this alot faster then having to write every single one down
05-31-2006 07:16 AM
Profile PM Find Quote Report
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: Combonation Outputter ?
that's just 00000 to 99999 isn't it?
[Image: 1-0.png]
             
05-31-2006 01:55 PM
Profile PM Web Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: Combonation Outputter ?
code:
for($i = 0; $i < 100000; $i++) {
   print ensure_len($i, 5) . "\n";
}

function ensure_len($num, $len) {
   $num = (string)$num;
   while(strlen($num) < $len) {
      $num = "0" . $num;
   }
   return $num;
}

That's a simple PHP script to do it... Shouldn't be too hard right:S
05-31-2006 02:18 PM
Profile E-Mail PM Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: Combonation Outputter ?
quote:
Originally posted by J-Thread
function ensure_len(
You could have used str_pad() for that, no? :p
05-31-2006 04:17 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On