<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def genRandResources(args, resources):
 """ Generates a list of the appropriate length containing a roughly equal number of all resources in a random order """

    randResources = []
    nEach = int(args.nPatches // len(resources))
    extras = int(args.nPatches % len(resources))
    for i in range(nEach):
        for res in resources:
            randResources.append(res + str(i))

    additional = random.sample(resources, extras)
    for res in additional:
        randResources.append(res + str(nEach))

    random.shuffle(randResources)
    return randResources