2013-10-25 13:45:09 +00:00
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
2014-07-02 10:48:36 +00:00
"POT-Creation-Date: 2014-07-02 12:51+0200\n"
2013-10-25 13:45:09 +00:00
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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
#: train302.languagecode:1
#, no-wrap
msgid "E"
msgstr "D"
#. type: Title-text
#: train302/scene.txt:1
#, no-wrap
msgid "train302:Follow with variables"
msgstr ""
#. type: Resume-text
#: train302/scene.txt:2
#, no-wrap
msgid "train302:Use variables in order to store the parameters of the path."
msgstr ""
#. type: ScriptName-text
#: train302/scene.txt:3
#, no-wrap
msgid "train302:Move"
msgstr ""
#. type: \b; header
#: train302-help/tmove2.txt:1
#, no-wrap
msgid "Exercise"
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:4
#, no-wrap
msgid ""
2014-07-02 10:48:36 +00:00
"This exercise is very similar to the previous one. The bot must move exactly in the same way, but when writing the program, you must use a new concept that is extremely important in programming: <a cbot|var>variables</a>.\n"
"We saw that all the pads are at a distance form each other of 20 meters. And all the rotations performed consist in 90 degree angles. Instead of rewriting the same values over and over again in the program, we can store them in a variable: "
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:7
#, no-wrap
msgid ""
"Instead of:\n"
"<c/><s/>\tmove(20);"
msgstr ""
#. type: \s; block (usually verbatim code)
#: train302-help/tmove2.txt:11
#, no-wrap
msgid ""
"\tturn(90);\n"
"\tmove(20);\n"
"\tturn(-90);\n"
"\t..."
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:14
#, no-wrap
msgid ""
"We write :\n"
"<c/><s/>\tdist = 20;"
msgstr ""
#. type: \s; block (usually verbatim code)
#: train302-help/tmove2.txt:20
#, no-wrap
msgid ""
"\tdir = 90;\n"
"\tmove(dist);\n"
"\tturn(dir);\n"
"\tmove(dist);\n"
"\tturn(-dir);\n"
"\t..."
msgstr ""
#. type: \b; header
#: train302-help/tmove2.txt:21
#, no-wrap
msgid "Variables"
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:23
#, no-wrap
msgid "A <a cbot|var>variable</a> is composed of three elements: \n"
msgstr ""
2014-07-02 10:48:36 +00:00
#. type: Bullet: '1)'
#: train302-help/tmove2.txt:23
2013-10-25 13:45:09 +00:00
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "The name,"
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: Bullet: '2)'
#: train302-help/tmove2.txt:24
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "The type of the content,"
msgstr ""
#. type: Bullet: '3)'
#: train302-help/tmove2.txt:25
#, no-wrap
msgid "The content."
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: \t; header
2014-07-02 10:48:36 +00:00
#: train302-help/tmove2.txt:27
2013-10-25 13:45:09 +00:00
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "The name"
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:29
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "Use the name to refer to a variable. For example, instead of writing <c/>move(20);<n/>, write <c/>move(dist);<n/>: \"dist\" is the name of the variable. You can choose almost any name for a variable, for example <code>dist</code>, <code>dir</code>, <code>p2</code>, <code>a</code>, <code>x</code>, <code>nothing_2_grab</code>, etc."
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: \t; header
#: train302-help/tmove2.txt:30
#, no-wrap
msgid "The type"
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:32
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "The type of a variable determines what kind of information the variable can contain. According to the type, a variable can contain a whole number, a real number, a character string, the coordinates of a point, etc. Here is a list with the most common variable types: \n"
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: Bullet: 'o'
#: train302-help/tmove2.txt:32
#, no-wrap
msgid "<code><a cbot|int>int</a></code> for a whole number (12, -500, etc.)"
msgstr ""
#. type: Bullet: 'o'
#: train302-help/tmove2.txt:33
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "<code><a cbot|float>float</a></code> for a real number (3.14, 0.2, -99.98, etc.)"
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: Bullet: 'o'
#: train302-help/tmove2.txt:34
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "<code><a cbot|string>string</a></code> for a character string (\"Hello!\", \"Nothing to grab\", etc.)"
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: Bullet: 'o'
#: train302-help/tmove2.txt:35
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "<code><a cbot|point>point</a></code> for the x,y,z-coordinates of a point in space"
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: Bullet: 'o'
#: train302-help/tmove2.txt:36
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "<code><a cbot|object>object</a></code> for the information about an object (bot, building, etc.) "
msgstr ""
#. type: \t; header
#: train302-help/tmove2.txt:38
#, no-wrap
msgid "The content"
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:40
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "The content of a variable can be a number, a string, coordinates, etc., according to the type of the variable. The content of a variable can change many times during the execution of a program. "
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:42
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "Before you can use a variable, you have to declare it. For example, before you can use the two variables <code>dist</code> and <code>dir</code>, you must declare them with the following lines: "
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: \s; block (usually verbatim code)
#: train302-help/tmove2.txt:45
#, no-wrap
msgid ""
"\tfloat dist;\n"
"\tfloat dir;"
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:47
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "Now you can use the two variables. To put the value 20 into <code>dist</code> and 90 into <code>dir</code>, write:"
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: \s; block (usually verbatim code)
#: train302-help/tmove2.txt:50
#, no-wrap
msgid ""
"\tdist = 20;\n"
"\tdir = 90;"
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:52
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "Now you can move and turn the bot with the instructions <code><a cbot|move>move</a></code> and <code><a cbot|turn>turn</code></a>:"
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: \s; block (usually verbatim code)
#: train302-help/tmove2.txt:55
#, no-wrap
msgid ""
"\tmove(dist);\n"
"\tturn(dir);"
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:57
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "You can also use a whole <a cbot|expr>mathematical expression</a> instead of just the variable:"
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: \s; block (usually verbatim code)
#: train302-help/tmove2.txt:60
#, no-wrap
msgid ""
"\tmove(dist+100);\n"
"\tturn(-dir);"
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:62
#, no-wrap
msgid "The latter instruction will be needed to turn the bot right. "
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:64
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "Now, rewrite the program of the previous exercise, but use a variable for the distance and another variable for the angle of the rotation. "
2013-10-25 13:45:09 +00:00
msgstr ""
#. type: \t; header
#: train302-help/tmove2.txt:65
#, no-wrap
msgid "See also"
msgstr ""
#. type: Plain text
#: train302-help/tmove2.txt:66
#, no-wrap
2014-07-02 10:48:36 +00:00
msgid "<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
2013-10-25 13:45:09 +00:00
msgstr ""