15
2
The scenario: You are a software designer working for a gov't-run company that designs license plates for cars and other vehicles. You've been asked to develop software that generates license plates. Before you got to work, your bosses laid down these ground rules.
A license plate cannot contain:
ASS
666
69<any number here>
<any number here>69
KKK
SHT
Rules and requirements:
- License plate must be randomly generated.
- Once a random license plate is generated, the same license plate cannot be generated again.
- You must output at least 200 unique license plates. You can generate more if you want to.
- You may store generated plates in a file to "remember" them.
- The license plate contains 2 sections, one containing only three letters, and one containing only three numbers, separated by a dash, like this:
233-ADF
orADF-233
. - You can only use numbers and capital letters.
- License plates can be written to stdout, or a file.
- Each "side" of a license plate will contain either three numbers or letters.
- This is a code-golf, so shortest, most popular, answer wins. Winner will be chosen after seven days.
General rules
- Answer should include, but not limited to, the following.
- Language name.
- Character count.
- File size.
- How the code is run.
- The code itself.
- Example: Python 234 chars or Python 23mb.
If I need to clarify any additional details, please mention it in the comments and I will add it to my post. Anyways, good luck, and generate me some appropriate license plates!
Update 1: Winner will be chosen slightly earlier.
Turns out I have to go on a trip soon, so I will be choosing a winner around 00:00 UTC, July 25. After the winner is chosen, you can still submit entires, just know that a winner has been chosen. Bai.
Update 2: Winners!
We have winners! Yay! Cheese and wine to everyone who participated! Here's who won.
- 1st place: Àngel - Bash (95 characters)
- 2nd place: Martin Büttner - Mathematica (182 bytes)
- 2nd place: Emilio M Bumachar - Pyg (92 ?)
- 2nd place: Peter Taylor - Golfscript (98 characters)
- 3rd place: Mark Thomas - Ruby (127 characters)
Wow, three second place ties. Wow. The competition is over, but feel free to submit entries if you want to. Bai!
2"Once a random license plate is generated, the same license plate cannot be generated again." What about non-random licence plates? – Peter Taylor – 2014-07-19T18:33:15.783
@PeterTaylor I'm a bit confused, what do you mean by "non-random"? – DatEpicCoderGuyWhoPrograms – 2014-07-19T18:34:15.527
4The obvious way to do this (and probably the way it works in real life) is to generate the numbers in order. – Peter Taylor – 2014-07-19T18:34:59.500
@PeterTaylor Sure, you can do that. – DatEpicCoderGuyWhoPrograms – 2014-07-19T18:36:42.573
Would suggest adding random requirement, else it is really trivial. – Vectorized – 2014-07-19T19:21:17.643
@bitpwner I did add that. – DatEpicCoderGuyWhoPrograms – 2014-07-19T19:21:47.113
5"Randomly generated" is imprecise. I presume you mean "uniformly selected at random from the unused legal licence plates" rather than, say, uniformly selected at random from the legal licence plates beginning
AAA-
– Peter Taylor – 2014-07-19T20:00:09.540@PeterTaylor Yes, you are correct. – DatEpicCoderGuyWhoPrograms – 2014-07-19T20:27:35.567
1please tell how many digits should be in every plate, and what characters are valid - it varies from country to country – proud haskeller – 2014-07-20T17:55:38.937
@proudhaskeller Each section contains three letters and three numbers, separated by a
-
, like this:ADD-127
or345-GHD
. – DatEpicCoderGuyWhoPrograms – 2014-07-20T17:58:04.160oh so its only 3 characters. it wasn't specified. thanks – proud haskeller – 2014-07-20T18:00:05.053
13I'm now somewhat tempted to write a program to generate random license plates that contain some obscene or otherwise inappropriate string not found in your list. – Ilmari Karonen – 2014-07-20T19:32:03.213
@IlmariKaronen Like what? Should what you're thinking of even be said aloud here? – DatEpicCoderGuyWhoPrograms – 2014-07-20T19:33:49.410
I'm sure you could think of plenty, but just to name a few obvious variations, you seem to have disallowed
SHT-___
but notSHI-7__
,_SH-17_
or__5-HIT
. – Ilmari Karonen – 2014-07-20T19:36:11.4371@IlmariKaronen I think it might be a little late to add new "banned words" as there are already 14 answers. – DatEpicCoderGuyWhoPrograms – 2014-07-20T20:03:55.237
1
Similarly,
– dan04 – 2014-07-21T06:19:11.720A55-___
is allowed by these rules.@dan04 If you read carefully, one side is letters, while the other side is numbers. Numbers and letters can't mix on the same side. – DatEpicCoderGuyWhoPrograms – 2014-07-21T13:50:56.357
The real government database of license plates is much larger. http://jalopnik.com/5975180/these-are-the-hilarious-vanity-license-plates-you-cant-have-in-georgia They are vanity plates in Georgia though
– Ming-Tang – 2014-07-22T06:39:49.097I'm 16 and I don't think I'm immature enough to put the banned words in my code lol, yet we have to be told its forbidden, what is this world coming to lol – Serial – 2014-07-22T09:25:21.260
Is it ok if a program generates plates having digits only on the left side e.g. 233-ADF or only on the right side e.g. ADF-233? – Cristian Ciupitu – 2014-07-23T22:19:52.463
@CristianCiupitu Yes, it is. – DatEpicCoderGuyWhoPrograms – 2014-07-24T00:19:57.883