473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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

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.
Nov 20 '05 #1
6 1852
Cor
Hi Tee,

I think that you have to look for this to the for index loops,

Cor
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 ...

Nov 20 '05 #2
Tee
Thanks for your reply.

Any simple example regarding this loop ?
Regards,
Tee
"Cor" <no*@non.com> wrote in message
news:ex*************@tk2msftngp13.phx.gbl...
Hi Tee,

I think that you have to look for this to the for index loops,

Cor
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 ...


Nov 20 '05 #3
Cor
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.

:-)

Any simple example regarding this loop ?

Nov 20 '05 #4
Tee
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 ...

"Cor" <no*@non.com> wrote in message
news:O7**************@TK2MSFTNGP12.phx.gbl...
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.

:-)

Any simple example regarding this loop ?


Nov 20 '05 #5
Cor
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
Nov 20 '05 #6
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.

"Tee" <th*@streamyx.com> wrote in message
news:OP**************@tk2msftngp13.phx.gbl...
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.

Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Rune Strand | last post by:
Hi, If I have a lot of integers and want do something with each digit as integer, what is the fastest way to get there? Eg. Make 12345 into an iterable object, like or "12345" (Btw: What is...
10
by: Sonoman | last post by:
Hi all: I am trying to write a simple program that simulates asking several persons their birth day and it counts how many persons are asked until two have the same birth day. The problem that I...
122
by: Einar | last post by:
Hi, I wonder if there is a nice bit twiddling hack to compare a large number of variables? If you first store them in an array, you can do: for (i = 0; i < n; i++) { if (array != value) {...
3
by: Kermit Piper | last post by:
Hello everyone, OK, let me try and explain again please. Here is what I'm trying to do. I have a 12-digit (UPC-A) javascript validation script which works great. All I need now is a similar...
9
by: twang090 | last post by:
Trying to create a 12 digit "guid", but have no idea on how to, anyone please have any thought? Thanks in advance.
2
by: hikmaz | last post by:
I am trying to get the rightmost digits (%10) of a number (taken from the user) and store it into successive array locations and get rid of the rightmost digit (\10) to store the next and so on and...
8
by: Marc | last post by:
Hi all, I have to generate and send to a printer many 6 digit alphanumeric strings. they have to be unique but I cannot check in a database or something like that if it have already been printed....
46
by: Neal Becker | last post by:
I'd like to turn off ZeroDivisionError. I'd like 0./0. to just give NaN, and when output, just print 'NaN'. I notice fpconst has the required constants. I don't want to significantly slow...
7
by: harijay | last post by:
Hi I am a few months new into python. I have used regexps before in perl and java but am a little confused with this problem. I want to parse a number of strings and extract only those that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.