1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
name = 'Robot'
description = 'Introductory Robot course.'
hint = {
'init':['''<p>In code the robot is represented by mindstorms_widgets(): <code>robot = mindstorms_widgets()</code>.</p>'''],
'connectMotorLeft':['''<p>Connect the left motor to the robot.</p>''',
'''<p><code>robot.connect_motor( 'left' )</code>.</p>'''],
'connectMotorRight':['''<p>Connect the right motor to the robot.</p>''',
'''<p><code>robot.connect_motor( 'right' )</code>.</p>'''],
'moveSteering':['''<p>Synchronize the motors.</p>''',
'''<p>Use move_steering method for synchonization <code>robot.move_steering( ... )</code>.</p>'''],
'moveSteeringOff':['''<p>Stop the motors.</p>''',
'''<p><code>robot.move_steering( 'off' )</code>.</p>'''],
'onForSeconds':['''<p>The first argument of <code>robot.move_steering</code> should specify that the motors will run for a certain amount of time.</p>''',
'''<p><code>robot.move_steering('on_for_seconds', ... )</code>.</p>'''],
'direction':['''<p>Define the direction of moving; negative/positive values represent a left/right turn.</p>'''],
'seconds':['''<p>Determine the running time of the motors.</p>'''],
'connectColorSensor':['''<p>Connect the color sensor to the robot.</p>''',
'''<p><code>robot.connect_sensor( 'color' )</code>.</p>'''],
'colorSensorMeasure':['''<p>While the robot is moving forward, it should use the color sensor in 'color' mode to recognize the colors.</p>''',
'''<p><code>robot.color_sensor_measure( 'color' )</code>.</p>'''],
'colorSensorMeasureRLI':['''<p>Use the color sensor in 'reflected_light_intensity' mode.</p>''',
'''<p><code>robot.color_sensor_measure( 'reflected_light_intensity' )</code>.</p>'''],
'moveTankOn':['''<p>Use the method for separate motor control, to set each motor's power separately.</p>''',
'''<p>The most appropriate for this is <code>robot.move_tank( ... )</code>.</p>''',
'''<p><code>robot.move_tank( 'on', ...)</code></p>'''],
'lrPower': ['''<p>Set the powers of the left and right motor.</p>''',
'''<p><code>robot.move_tank( 'on', lr_power=[ ... ])</code></p>'''],
'moveTankOff': ['''Stop the robot.''',
'''<p><code>robot.move_tank( 'off' )</code></p>'''],
'onForRotations':['''<p>Set the first argument of <code>robot.move_steering</code> method so that the motors will run for the specified number of rotations.</p>''',
'''<p><code>robot.move_steering('on_for_rotations', ... )</code>.</p>'''],
'rotations':['''<p>Determine the number of rotations; how many turns should the motors do in a meter? Measure the circumference of the wheel and compute the number of rotations per meter.</p>''',
'''<p><code>robot.move_steering( 'on_for_rotations', direction=0, rotations=5 )</code>.</p>'''],
'no_hint': ['''\
<p>No hint here!</p>
'''],
'system_error': ['''\
<p><span style="color: red;">System error:</span> [%=message%].</p>
'''],
'test_results': ['''\
<p>Your program passed [%=passed%] / [%=total%] tests.</p>
'''],
}
|