Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Random combination of letter generator

  1. Nov 19, 2014 #1
    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?
  2. jcsd
  3. Nov 19, 2014 #2


    User Avatar
    Science Advisor

    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.
  4. Nov 19, 2014 #3
    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.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook