-2

So I know there are websites out there that do this for you, but not to the extent that I need. I want to be able to Create a 13 Digit Alpha Numeric code several times over, if possible have it spit out 1,000 codes at a time. However my problem is I only want there to be 4 numbers max(so 0-4 out of the 13 will be numbers and the rest CAPITAL letters), here is an example: CHC-RCJV-6KK-ZUA . The Hyphens are not a neccesity. I am new to coding for the most part, I'm not sure if it's possible to do this on windows If so I would prefer it, however I can use linux if needed. Thanks for any help!

Alex K.
  • 171,639
  • 30
  • 264
  • 288
  • This is really to broad, simplest approach would be to generate a 9 character A..Z only random string *then* insert 4 random 0..9 – Alex K. Aug 23 '17 at 15:07
  • Welcome to Stack Overflow! You seem to be asking for someone to write some code for you. Stack Overflow is a question and answer site, not a code-writing service. Please [see here](http://stackoverflow.com/help/how-to-ask) to learn how to write effective questions. – rakwaht Aug 23 '17 at 15:07
  • Have you tried anything so far? What exactly was the problem? – Mureinik Aug 23 '17 at 15:10
  • @rakwaht I don't recall asking anyone to do ANYTHING for me? I would like to know the steps I would need to take in order to do something like this since I am new to coding as I said. Do not downvote me and accuse me of something I did not do. – Edward Mauzey Aug 23 '17 at 15:15

1 Answers1

0

You want up to 4 random digits and the rest capital letters. That gives you a five stage process:

  1. Pick how many digits, from the range [0..4].

  2. Pick that many random single digits and store them in a list.

  3. Pick up to 13 random capital letters and store them in the same list.

  4. Shuffle the contents of your list.

  5. Insert the hyphens and print/display/return/whatever.

Try coding that for yourself. If you have problems making it work then show us your code and we will help you.

rossum
  • 15,344
  • 1
  • 24
  • 38