import random


def generate_particles(n, L):
    """Generates random coordinates for n particles. Returns a dictionary mapping particle ID to coordinates"""

    vec_dict = {}

    # create n particles 
    for i in range(0, n):
        particle_coords = []

        # randomise their coordinates
        for j in range(0, 3):
            coord = random.uniform(0, L)
            particle_coords.append(coord)

        vec_dict[i] = particle_coords

    return vec_dict