473,796 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1873
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******** *****@tk2msftng p13.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******** ******@TK2MSFTN GP12.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.c om> wrote in message
news:OP******** ******@tk2msftn gp13.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
32660
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 the English term for this process; itemize? tokenize? digitize? sequence?) Some examples:
10
2911
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 have is that the first loop I get a sequence of random numbers untuil I get a match, BUT then on the following loops I get the SAME random(?) sequence. I am using rand(). I do not want to get too fancy with the random number generator, but is there...
122
5348
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) { /* array differs from value, do something*/
3
9333
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 script for 8-digit (UPC-E) type script? I don't want to convert it to a 12-digit UPC-A before validating it as a 12-digit number. I would prefer to just be able to calc the number, as an 8-digit number, check digit and all, just like I am currently...
9
6940
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
27382
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 so forth. For example, if the number entered by the user is 4321 then, int array = 1 int array = 2 int array = 3 int array = 4 int array = '\0' (End of array - when number == 0) This is the piece of code i...
8
7210
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. the string has also to seem a random one and it cannot have an apparence of a sequence. My first approach is to do it with a decimal counter and find and use an encryption alghorithm that converts each 6 digit decimal number to a 6 digit...
46
15347
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 floating point math, so I don't want to just trap the exception. If I use C code to turn off the hardware signal, will that stop python from detecting the exception, or is python checking for 0 denominator on it's own (hope not, that would waste...
7
21602
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 contain a 4 digit number anywhere inside a string However the regexp p = re.compile(r'\d{4}')
0
9680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10456
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5442
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.