![]() |
How to locate 4 digits into arrays
Good days, everyone
For instance, i have one number with 4 digits (2234). There are 12 times to turn this 4digits:- 2234, 2243, 2324, 2342, 2432, 2423, 3224, 3242, 3422, 4322, 4232, 4223 So these digits remain the same, but the position of digits is different. Can anyone provide solution? Thank you very much for ur kindness and assistance. :) |
Re: How to locate 4 digits into arrays
Your question is a little unclear. Not sure what you are wanting to accomplish completely.
i would probably suggest putting the 12 versions of the number into an array and call it with rnd Code:
|
Re: How to locate 4 digits into arrays
thanks for ur reply...
What i meant is i was given a number (2234). So i wish to generate a program to produce 12 numbers with same digits but different position. Original number = 2234 Different position for this number :- -2234 -2243 -2324 -2342 -2432 -2423 -3224 -3242 -3422 -4322 -4232 -4223 If i insert each number into array, it looks like inconsistency. |
Re: How to locate 4 digits into arrays
ok, here is quick and dirty. not pretty and not dynamic but it will get the results which should be actually 16 not 12.
Code:
Dim x As Integer, y As Integer |
but this method will have repeated number, how to get unique number??
|
| All times are GMT +5.5. The time now is 06:16. |