Random combination of letter generator

Click For Summary
SUMMARY

This discussion focuses on generating unique random letter sequences of 3-4 characters using programming languages such as Java, C, MATLAB, and Visual Basic. The proposed solution involves utilizing a predefined random function to create sequences, storing them in a vector or array, and ensuring that each newly generated sequence is unique by checking against previously generated ones. The conversation highlights the importance of user interaction, suggesting that sequences can be generated upon button clicks rather than automatically.

PREREQUISITES
  • Understanding of random number generation in programming languages (Java, C, MATLAB, Visual Basic)
  • Familiarity with data structures such as vectors or arrays
  • Basic programming skills to implement loops and conditionals
  • Knowledge of user interface elements in Visual Basic for button creation
NEXT STEPS
  • Learn how to implement random number generation in MATLAB
  • Research the use of arrays and vectors in Visual Basic
  • Explore methods for generating exhaustive lists of character combinations
  • Study event-driven programming in Visual Basic to handle button clicks
USEFUL FOR

Programmers and developers interested in creating applications that require unique random sequence generation, particularly those using Visual Basic or MATLAB.

rppearso
Messages
196
Reaction score
3
Does anyone know where I can go to figure out how to generate a random 3-4 letter sequence BUT with every click that sequence is stored in an array and can not come up again?
 
Physics news on Phys.org
Do you have access to a programming language (Java, C, Pascal, etc...) with a prefined random function? Then, it should be no problem to translate a random number between 0 and 1 to a 3 or 4-letter sequence. Then, save all your sequences in a vector, and for every newly generated sequence, check if it is already in the vector, and generate a new one if it is so.
 
Erland said:
Do you have access to a programming language (Java, C, Pascal, etc...) with a prefined random function? Then, it should be no problem to translate a random number between 0 and 1 to a 3 or 4-letter sequence. Then, save all your sequences in a vector, and for every newly generated sequence, check if it is already in the vector, and generate a new one if it is so.

Hello Erland,

Thank you so much, I have access to MATLAB and visual basic. I have a moderate amount of experience with both but I am a little shakey on forming a vector and having the loop read from that vector. I know visual basic has a "randomize timer" function. Not sure about matlab. With Visual basic I can create buttons to display a new combination each time. So actually it would not even be a loop because I would want it initiated from a button click rather than automaticly. Of course another method might be to display all the possible combinations at one time and I could just scour through them.

It might be better to produce an exhuastive list of all possible letter combinations for 3 or 4 charachters.
 
If there are an infinite number of natural numbers, and an infinite number of fractions in between any two natural numbers, and an infinite number of fractions in between any two of those fractions, and an infinite number of fractions in between any two of those fractions, and an infinite number of fractions in between any two of those fractions, and... then that must mean that there are not only infinite infinities, but an infinite number of those infinities. and an infinite number of those...

Similar threads

  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K