Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. import turtle as tu
  2. a = open('./ev3-arm/ev3_arm_output','r').read()
  3. a=a.split('\n')
  4. tu.showturtle()
  5. tu.speed(1)
  6. x,y=-300,0
  7. tu.penup()
  8. tu.goto(x,y)
  9. for i in a[:-1]:
  10.     if 'pen_up' in i:
  11.         tu.penup()
  12.     elif 'pen_down' in i:
  13.         tu.pendown()
  14.     else:
  15.         if i[0]=='A':
  16.             y+=float(i.split('|')[1])*float(i.split('|')[2])/(75*10)
  17.         else:
  18.             x+=float(i.split('|')[1])*float(i.split('|')[2])/(15)
  19.     tu.goto(x,y)
  20. tu.done()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement