import server 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']+['''
Use move_steering method with 'on' as the first parameter robot.move_steering( 'on',... )
.
Use the while loop: inside, the robot should read the current color and increase the counter when the color changes.
''', '''Interrupt the loop after a certain amount of time; determine the time the robot needs to drive over all the colors experimentally; use time.time()
.
while time.time()-start < 1.5:
.
The program should: