def show(L, turtle_cmds): """Show the current production of the Lima L.""" turtle_script = L.translate(turtle_cmds) coords = turtle.play("reset();" + turtle_script) if len(coords) > 0: F = Formex(coords) clear() draw(F)
def show(i,L,turtle_cmds,clear=True): """Show the current production of the Lima L.""" global FA,TA turtle_script = L.translate(turtle_cmds) coords = turtle.play("reset();" + turtle_script) if len(coords) > 0: if clear: prop = 0 else: prop = i FB = draw(Formex(coords,prop)) if clear: undraw(FA) FA = FB TB = drawText("Generation %d"%i,20,20) undecorate(TA) TA = TB
def show(i, L, turtle_cmds, clear=True, text=True, colors=True): """Show the current production of the Lima L.""" global FA, TA turtle_script = L.translate(turtle_cmds) coords = turtle.play("reset();" + turtle_script) if len(coords) > 0: if colors: prop = i else: prop = 0 FB = draw(Formex(coords, prop)) if clear: undraw(FA) FA = FB if text: TB = drawText("Generation %d" % i, 40, 40, size=24) undecorate(TA) TA = TB