How to turn a 4 digit number into 24 different sequence ?

  • Thread starter Thread starter Tee
  • Start date Start date
T

Tee

Hi,

Can anyone suggest me a good way to turn a 4 digit number into 24 different
sequence in a smart way ?
I mean smart way ... actually I not quite sure what I need, but just wonder
if anyone have a cool way to make it.

example : 1234 can change to 1243, 1423, 1432, 1423, 4123, 3124 so on and so
forth .... there will be total 24 different sequence ...

anyone can help ?


Thanks.
 
Hi Tee,

No because I do not see the logic and was not even trying, because when you
have made one type I am trying till tonight.

:-)
 
I don't know how is this loop looks like at all ... lol ...
that's why I need an example for this loops ... just want to know how it
looks like, so maybe I can use it to make the 24 different number ...
 
dim a as integer = 0
dim b as new arraylist
for x as integer = 1 to 4
for y as integer = 1 to 4
b(a) = x.tostring & y.tostring
a += 1
next
next
Makes a table as
11
12
13
14
21
etc
untill
44

I hope this sample shows it a little bit?

Cor
 
Tee:

You're talking about permutations... this is standard homework-like code.
You can find examples of permutations all over the Internet and in books on
programming algorithms.
 
Back
Top