It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

combination maker

Moderator: dafunkymunky

combination maker

Postby myrv on Fri Oct 26, 2007 5:24 pm

I am currently learning VB xpress, could anyone help me out with some code:
I am trying to write a program which creates all possible combinations from 6 input digits and list the final result in a listbox. any help will be greatful :cry:

example: input 145
145
154
451
415
514
541
myrv
 
Posts: 0
Joined: Fri Oct 26, 2007 5:15 pm

Postby sgp3213 on Sat Nov 03, 2007 8:54 pm

Reminds me of something i programmed in Java. Heres how something like that can work.

O and if your input allows numbers that aren't limited to three digits, tell me and ill change my response accordingly. Anyway...

'pre-condition: Input must be a 3-digit integer
'post-condition: The 6 ways of writing the 3-digit number are stored in a listbox.

input=some int
int a=(someint%10)
int b=(someint/10)
int c=(b%10)
int d=(b/10)

Put these values in a listbox(do know how that works right?)
(d*100)+(c*10)+a
(d*100)+(a*10)+c
(c*100)+(d*10)+a
(c*100)+(a*10)+d
(a*100)+(d*10)+c
(a*100)+(c*10)+d

ex. input=145
int a 145%10 => 5
int b 145/10=> 14
int c 14%10=> 4
int d 14/10=> 1

listbox has the values:
145
154
451
415
514
541


Glad to help
--Sammy Mohamed
sgp3213
 
Posts: 5
Joined: Sat Nov 03, 2007 8:36 pm

Re: combination maker

Postby myrv2 on Wed Apr 13, 2011 11:54 pm

I am also looking into a program which will give a list of 5 digit combinations from a range of 30 numbers. My email is ncjaclyn@yahoo.com/. Please post your email or send a short reply to me at mine so we can collaborate. I would like to hear mire about the software you are using.
myrv2
 
Posts: 1
Joined: Wed Apr 13, 2011 11:51 pm


Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests