예제 #1
0
def lima(axiom,rules,level,turtlecmds,glob=None):
    """Create a list of connected points using a Lindenmayer system.

    axiom is the initial string,
    rules are translation rules for the characters in the string,
    level is the number of generations to produce,
    turtlecmds are the translation rules of the final string to turtle cmds,
    glob is an optionallist of globals to pass to the turtle script player.
    """
    A = Lima(axiom,rules)
    A.grow(level)
    scr = "reset();"+A.translate(turtlecmds,keep=False)
    list = turtle.play(scr,glob)
    return list
예제 #2
0
def lima(axiom,rules,level,turtlecmds,glob=None):
    """Create a list of connected points using a Lindenmayer system.

    axiom is the initial string,
    rules are translation rules for the characters in the string,
    level is the number of generations to produce,
    turtlecmds are the translation rules of the final string to turtle cmds,
    glob is an optional list of globals to pass to the turtle script player.

    This is a convenience function for quickly creating a drawing of a
    single generation member. If you intend to draw multiple generations
    of the same Lima, it is better to use the grow() and translate() methods
    directly.
    """
    A = Lima(axiom,rules)
    A.grow(level)
    scr = "reset();"+A.translate(turtlecmds,keep=False)
    list = turtle.play(scr,glob)
    return list
예제 #3
0
파일: lima.py 프로젝트: gunnups/pyFormex
def lima(axiom, rules, level, turtlecmds, glob=None):
    """Create a list of connected points using a Lindenmayer system.

    axiom is the initial string,
    rules are translation rules for the characters in the string,
    level is the number of generations to produce,
    turtlecmds are the translation rules of the final string to turtle cmds,
    glob is an optional list of globals to pass to the turtle script player.

    This is a convenience function for quickly creating a drawing of a
    single generation member. If you intend to draw multiple generations
    of the same Lima, it is better to use the grow() and translate() methods
    directly.
    """
    A = Lima(axiom, rules)
    A.grow(level)
    scr = "reset();" + A.translate(turtlecmds, keep=False)
    list = turtle.play(scr, glob)
    return list