def main(iteration): turtle = axi.Turtle() for i in range(1, 2**iteration): turtle.forward(1) if (((i & -i) << 1) & i) != 0: turtle.circle(-1, 90, 36) else: turtle.circle(1, 90, 36) drawing = turtle.drawing.rotate_and_scale_to_fit(11, 8.5, step=90) axi.draw(drawing)
def draw_box(self): turtle = axi.Turtle() turtle.up() turtle.goto(self.params['x0'], self.params['y0']) turtle.down() turtle.goto(self.params['x1'], self.params['y0']) turtle.goto(self.params['x1'], self.params['y1']) turtle.goto(self.params['x0'], self.params['y1']) turtle.goto(self.params['x0'], self.params['y0']) turtle.up() self.device.run_drawing(turtle.drawing, True)
def main(iteration): turtle = axi.Turtle() for i in range(1, 2 ** iteration): turtle.forward(1) if (((i & -i) << 1) & i) != 0: turtle.circle(-1, 90, 36) else: turtle.circle(1, 90, 36) cli = axi.cli() cli.draw(turtle.drawing)
import axi import time d = axi.Device() d.enable_motors() turtle = axi.Turtle() ##turtle.goto(0,0) # #turtle.pd() #turtle.pu() turtle.goto(5, 1) for i in range(360): print "move forward by 1" #turtle.pd() # pen down turtle.forward(0.01) # gehe 0.5inch nach vorwaerts turtle.rt(1) # drehe dich um 60grad #turtle.pu() # pen up drawing = turtle.drawing axi.draw(drawing) d.disable_motors()