Generate random code in subset of CL