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. 6 1873
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 ...
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 ...
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 ?
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 ?
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.
"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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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:
|
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...
|
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*/
|
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...
|
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.
| |
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...
|
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...
|
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...
|
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}')
|
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...
|
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...
| |
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,...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |