summaryrefslogtreecommitdiff
path: root/robot/problems/introduction/inline.py
blob: 67a6f06067c6a4e498288e2b2b689958fe9bedcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
solution = '''\
from ev3dev import *
from mindstorms_widgets import mindstorms_widgets

robot = mindstorms_widgets()
robot.connect_motor( 'left' )
robot.connect_motor( 'right' )
robot.connect_sensor( 'ultrasonic' )
robot.move_steering( 'on', power=80 )
while robot.ultrasonic_sensor_measure( 'distance-cm' ) > 500:
	pass
robot.move_steering( 'on', power=20 )
while robot.ultrasonic_sensor_measure( 'distance-cm' ) > 200:
	pass
robot.move_steering( 'off' )
'''

print (any(('power' in s and '80' in s and '=' in s) for s in solution.split('\n')))