Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

SR2019-Broken-Syntax

a guest Nov 13th, 2018 20 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. from sr.robot import *
  2.  
  3. R = robot()
  4.  
  5.  
  6. def drive_forward(speed):
  7.     r.motors[].m0.power = speed
  8.     r.motors[].m1.power = speed
  9.  
  10.  
  11. def drive_backwards(speed):
  12.     r.motors[].m0.power = -speed
  13.     R.motors[].m1.power = -speed
  14.  
  15.  
  16. def look_for_token_markers()
  17.     markers = R.see()
  18.    arena_markers = []
  19.     for m in markers:
  20.         if m.info.marker_type = MARKER_ARENA:
  21.             arena_markers.append(m)
  22.     return arena_markers
  23.  
  24. while True:
  25.     markers = look_for_token_markers()
  26.     if markers:
  27.         Drive_forward(20)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top