# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: DATE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: One-char language identifier #: levels-po/exercises/chapter004/level005/scene_langchar.txt:1 #, no-wrap msgid "E" msgstr "" #. type: Title-text #: levels/exercises/chapter004/level005/scene.txt:1 #, no-wrap msgid "Shadow" msgstr "" #. type: Resume-text #: levels/exercises/chapter004/level005/scene.txt:2 #, no-wrap msgid "Follow a bot, as if you were its shadow." msgstr "" #. type: ScriptName-text #: levels/exercises/chapter004/level005/scene.txt:3 #, no-wrap msgid "Follow" msgstr "" #. type: \b; header #: levels/exercises/chapter004/level005/help/help.E.txt:1 #, no-wrap msgid "Exercise" msgstr "" #. type: Plain text #: levels/exercises/chapter004/level005/help/help.E.txt:3 #, no-wrap msgid "" "You must follow the target bot with the explosive " "device, but without touching it, otherwise it will blow up. Every time the " "target bot stops, you must be close to it (less than 10m). After you managed " "to stay close to the target bot at 10 successive stops, it will lead you to " "the finishing pad, and the exercise is over. At every stop, the target bot " "checks that you are there. If you are not there, you must start over again." msgstr "" #. type: \b; header #: levels/exercises/chapter004/level005/help/help.E.txt:4 #, no-wrap msgid "General principle" msgstr "" #. type: Plain text #: levels/exercises/chapter004/level005/help/help.E.txt:6 #, no-wrap msgid "Repeat forever :\n" msgstr "" #. type: Bullet: 'o' #: levels/exercises/chapter004/level005/help/help.E.txt:6 #, no-wrap msgid "Look for the target bot." msgstr "" #. type: Bullet: 'o' #: levels/exercises/chapter004/level005/help/help.E.txt:7 #, no-wrap msgid "Calculate the distance to the bot." msgstr "" #. type: Bullet: 'o' #: levels/exercises/chapter004/level005/help/help.E.txt:8 #, no-wrap msgid "if the distance to the target bot is less than 5m, move backward." msgstr "" #. type: Bullet: 'o' #: levels/exercises/chapter004/level005/help/help.E.txt:9 #, no-wrap msgid "Otherwise, calculate the direction of the target bot, and move towards it." msgstr "" #. type: Plain text #: levels/exercises/chapter004/level005/help/help.E.txt:12 #, no-wrap msgid "" "As many times before, use while (true) in " "order to perform the infinite loop:" msgstr "" #. type: \s; block (usually verbatim code) #: levels/exercises/chapter004/level005/help/help.E.txt:16 #, no-wrap msgid "" "while (true)\n" "{\n" "\tinstructions to be repeated ...\n" "}" msgstr "" #. type: Plain text #: levels/exercises/chapter004/level005/help/help.E.txt:18 #, no-wrap msgid "" "Look for the target bot with the instruction radar:" msgstr "" #. type: \s; block (usually verbatim code) #: levels/exercises/chapter004/level005/help/help.E.txt:19 #, no-wrap msgid "\ttarget = radar(TargetBot);" msgstr "" #. type: Plain text #: levels/exercises/chapter004/level005/help/help.E.txt:21 #, no-wrap msgid "You do not have to test if the radar found a target bot: there must be one." msgstr "" #. type: Plain text #: levels/exercises/chapter004/level005/help/help.E.txt:23 #, no-wrap msgid "" "Use the instruction distance( , ) to calculate " "the distance between two points. The first point will be the position of " "your own bot, given by position. The second point is the " "position of the target bot, given by target.position." msgstr "" #. type: \s; block (usually verbatim code) #: levels/exercises/chapter004/level005/help/help.E.txt:24 #, no-wrap msgid "len = distance(position, target.position);" msgstr "" #. type: Plain text #: levels/exercises/chapter004/level005/help/help.E.txt:30 #, no-wrap msgid "" "If the distance to the target bot is smaller than 5m, move backward with a " "speed inversely proportional to the distance: the closer you are to the bot, " "the faster you must move backward.\n" "\tDistance = 5.0 meters -> speed = 0.0\n" "\tDistance = 2.5 meters -> speed = -0.5\n" "\tDistance = 0.0 meters -> speed = -1.0\n" "You can use the expression distance/5-1 in " "order to achieve this, together with the if to " "test if the target is closer than 5m:" msgstr "" #. type: \s; block (usually verbatim code) #: levels/exercises/chapter004/level005/help/help.E.txt:34 #, no-wrap msgid "" "if ( len < 5 ) // too close ?\n" "{\n" "\tmotor(len/5-1, len/5-1); // moves backward\n" "}" msgstr "" #. type: Plain text #: levels/exercises/chapter004/level005/help/help.E.txt:36 #, no-wrap msgid "" "If the distance to the target is greater than 5m, move towards the " "target. First calculate the angle necessary to face the target with the " "instruction direction. You can then adjust " "the speed of the right-hand and left-hand motor in order to follow the " "target:" msgstr "" #. type: \s; block (usually verbatim code) #: levels/exercises/chapter004/level005/help/help.E.txt:48 #, no-wrap msgid "" "else\n" "{\n" "\tdir = direction(target.position);\n" "\tif ( dir >= 0 ) // target on the left side?\n" "\t{\n" "\t\tmotor(1-dir/90, 1);\n" "\t}\n" "\telse // target on the right side?\n" "\t{\n" "\t\tit is up to you to fill in\n" "\t}\n" "}" msgstr "" #. type: Plain text #: levels/exercises/chapter004/level005/help/help.E.txt:55 #, no-wrap msgid "" "When the target is on your left, dir takes a positive value, " "ranging between 0 and 180. The expression " "1-dir/90 returns a speed ranging between 1 and -1, according to " "the direction:\n" "\tdirection = 0 -> speed = 1.0\n" "\tdirection = 45 -> speed = 0.5\n" "\tdirection = 90 -> speed = 0.0\n" "\tdirection = 135 -> speed = -0.5\n" "\tdirection = 180 -> speed = -1.0" msgstr "" #. type: Image filename #: levels/exercises/chapter004/level005/help/help.E.txt:56 #, no-wrap msgid "radar2" msgstr "" #. type: Plain text #: levels/exercises/chapter004/level005/help/help.E.txt:58 #, no-wrap msgid "" "When the target is on the right side, dir is negative, ranging " "between 0 and -180." msgstr "" #. type: Plain text #: levels/exercises/chapter004/level005/help/help.E.txt:60 #, no-wrap msgid "" "The only task left for you now is to declare the variables " "that you use in the program. target is of type " "object, whereas dir and len are of " "type float." msgstr "" #. type: \t; header #: levels/exercises/chapter004/level005/help/help.E.txt:61 #, no-wrap msgid "See also" msgstr "" #. type: Plain text #: levels/exercises/chapter004/level005/help/help.E.txt:62 #, no-wrap msgid "" "Programming, types and categories." msgstr ""