summaryrefslogtreecommitdiff
path: root/robot/problems/introduction/countlines/en.py
diff options
context:
space:
mode:
authorMartin Možina <martin.mozina@fri.uni-lj.si>2015-12-28 10:23:46 +0100
committerMartin Možina <martin.mozina@fri.uni-lj.si>2015-12-28 10:23:46 +0100
commit165c7165bb2184c9c9e0576a074ba4f29052bf8f (patch)
tree9b86dbbd1d4c39b52bfd7f54cfb13c2354727a53 /robot/problems/introduction/countlines/en.py
parent4cdea335b0951e3c12dfb7b906f958d6b5be25c6 (diff)
parentc1bb0d56b2c0482c766d094c65fdf0fd9d1aa0ba (diff)
Merge branch 'master' of 192.168.15.97:codeq-problems
Conflicts: python/problems/functions/palindrome/sl.py python/problems/functions/palindromic_numbers/sl.py
Diffstat (limited to 'robot/problems/introduction/countlines/en.py')
-rw-r--r--robot/problems/introduction/countlines/en.py27
1 files changed, 25 insertions, 2 deletions
diff --git a/robot/problems/introduction/countlines/en.py b/robot/problems/introduction/countlines/en.py
index 8b3b275..7655b21 100644
--- a/robot/problems/introduction/countlines/en.py
+++ b/robot/problems/introduction/countlines/en.py
@@ -1,14 +1,37 @@
# coding=utf-8
import server
-mod = server.problems.load_language('python', 'en')
+mod = server.problems.load_language('robot', 'en')
id = 206
name = 'Count lines'
slug = 'Count lines'
description = '''\
+ Write a program to count the color lines on white background using the robot with a color sensor. The robot should drive forward, crossing the lines and count them.
'''
hint = {
-
+ 'mW_init':mod.hint['init'],
+ 'connectMotorLeft':mod.hint['connectMotorLeft'],
+ 'connectMotorRight':mod.hint['connectMotorRight'],
+ 'moveSteeringOn':mod.hint['moveSteering']+['''<p>Use move_steering method with 'on' as the first parameter <code>robot.move_steering( 'on',... )</code>.</p>'''],
+ 'moveSteeringOff':mod.hint['moveSteeringOff'],
+ 'connectColorSensor':mod.hint['connectColorSensor'],
+ 'colorSensorMeasure':mod.hint['colorSensorMeasure'],
+ 'while':['''<p>Use the while loop: inside, the robot should read the current color and increase the counter when the color changes.</p>''',
+ '''<p>Interrupt the loop after a certain amount of time; determine the time the robot needs to drive over all the colors experimentally; use <code>time.time()</code>.</p>''',
+ '''<p><code>while time.time()-start < 1.5:</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>connect the color sensor.</li>
+ <li>synchronize the motors and run them so that the robot would move forward.</li>
+ <li>inside the loop, let the robot recognize colors and increase the counter.</li>
+ <li>interrupt the loop after a certain amount of time.</li>
+ <li>stop the motors.</li>
+</ol>'''
+]