Skip to main content
Shorten program: use a dict instead of a set
Source Link

Python3, 263257 chars

import string as X,re,random as R
I=[0,1,2]
s=set()s={}
while len(s)<200:
 L=R.sample([[R.choice(X.digits) for i in I],[R.choice(X.ascii_uppercase) for i in I]],2)
 L='';L=''.join(L[0]+['-']+L[1])
 if re.search('ASS|KKK|SHT|69|666',L) or L in s:continue
 print(L);s.add(L);s[L]=0

Sample output:

# python3 shortened.py
EUN-215
546-SIL
464-ZTR
XIX-794

Python3, 263 chars

import string as X,re,random as R
I=[0,1,2]
s=set()
while len(s)<200:
 L=R.sample([[R.choice(X.digits) for i in I],[R.choice(X.ascii_uppercase) for i in I]],2)
 L=''.join(L[0]+['-']+L[1])
 if re.search('ASS|KKK|SHT|69|666',L) or L in s:continue
 print(L);s.add(L)

Sample output:

# python3 shortened.py
EUN-215
546-SIL
464-ZTR
XIX-794

Python3, 257 chars

import string as X,re,random as R
I=[0,1,2]
s={}
while len(s)<200:
 L=R.sample([[R.choice(X.digits) for i in I],[R.choice(X.ascii_uppercase) for i in I]],2);L=''.join(L[0]+['-']+L[1])
 if re.search('ASS|KKK|SHT|69|666',L) or L in s:continue
 print(L);s[L]=0

Sample output:

# python3 shortened.py
EUN-215
546-SIL
464-ZTR
XIX-794
use H2, randomize order of digits&letters parts, included sample output
Source Link

Python3, 248 chars

Python3, 263 chars

import string as S
from X,re,random import choice as C
import reR
R=[0I=[0,1,2]
s=set()
while len(s)<200:
 L=''L=R.joinsample([C[[R.choice(SX.digits) for i in R]+['-']+[CI],[R.choice(SX.ascii_uppercase) for i in R]I]],2)
 L=''.join(L[0]+['-']+L[1])
 if re.search('ASS|KKK|SHT|69|666',L) or L in s:continue
 print(L);s.add(L)

Sample output:

# python3 shortened.py
EUN-215
546-SIL
464-ZTR
XIX-794

Python3, 248 chars

import string as S
from random import choice as C
import re
R=[0,1,2]
s=set()
while len(s)<200:
 L=''.join([C(S.digits) for i in R]+['-']+[C(S.ascii_uppercase) for i in R])
 if re.search('ASS|KKK|SHT|69|666',L) or L in s:continue
 print(L);s.add(L)

Python3, 263 chars

import string as X,re,random as R
I=[0,1,2]
s=set()
while len(s)<200:
 L=R.sample([[R.choice(X.digits) for i in I],[R.choice(X.ascii_uppercase) for i in I]],2)
 L=''.join(L[0]+['-']+L[1])
 if re.search('ASS|KKK|SHT|69|666',L) or L in s:continue
 print(L);s.add(L)

Sample output:

# python3 shortened.py
EUN-215
546-SIL
464-ZTR
XIX-794
Source Link

Python3, 248 chars

import string as S
from random import choice as C
import re
R=[0,1,2]
s=set()
while len(s)<200:
 L=''.join([C(S.digits) for i in R]+['-']+[C(S.ascii_uppercase) for i in R])
 if re.search('ASS|KKK|SHT|69|666',L) or L in s:continue
 print(L);s.add(L)