def gen_gradient(args, resource, inflow, radius, loc, common=True):
    """
    Returns a line of text to add to an environment file, initializing a
    gradient resource with the specified
    name (string), inflow(int), radius(int), and location (tuple of ints)
    """
    return "".join(["GRADIENT_RESOURCE ", str(resource), ":height=",
                    str(radius), ":plateau=", str(inflow), ":spread=",
                    str(radius-1), ":common=", str(int(common)),
                    ":updatestep=1000000:peakx=", str(loc[0]), ":peaky=",
                    str(loc[1]), ":plateau_inflow=", str(inflow), ":initial=",
                    str(inflow) + "\n"])
Returns a line of text to add to an environment file, initializing a
    gradient resource with the specified
    name (string), inflow(int), radius(int), and location (tuple of ints)