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
|
import server
mod = server.problems.load_language('robot', 'en')
id = 205
name = 'Circle 20 cm'
slug = 'Circle 20 cm'
description = '''\
<p>Write a program that will make the robot drive in circle (r=20cm) and stop after one loop.</p>'''
hint = {
'mW_init':mod.hint['init'],
'connectMotorLeft':mod.hint['connectMotorLeft'],
'connectMotorRight':mod.hint['connectMotorRight'],
'moveSteering':mod.hint['moveSteering'],
'onForSeconds':mod.hint['onForSeconds'],
'direction':mod.hint['direction']+['''<p>The value of this parameter should be such that would make the robot circle with radius 20cm. This value highly depends on the construction of the robot.</p>''',
'''<p><code>robot.move_steering( 'on_for_seconds', direction=20, ... )</code>.</p>'''],
'seconds':mod.hint['seconds']+['''<p>Experimentally determine the time (in seconds) the robot needs for one loop.</p>''',
'''<p><code>robot.move_steering( 'on_for_seconds', direction=0, seconds=3 )</code>.</p>'''],
}
plan = ['''\
<p>The program should:</p>
<ol>
<li>create a mindstorms_widgets() object, which represents the robot in your code.</li>
<li>connect the driving motors.</li>
<li>calculate the turn so that the robot would drive in circle with radius 20 cm.</li>
<li>synchronize the motors and run them for a specified time, so that the robot stops after one round.</li>
</ol>'''
]
|