# 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. msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \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: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Translate Toolkit 1.11.0\n" #. type: Title-text #: ../scene.txt:1 #, no-wrap msgid "A function" msgstr "Eine Funktion" #. type: Resume-text #: ../scene.txt:2 #, no-wrap msgid "Create a function in order to make your program shorter." msgstr "Definieren Sie eine neue Funktion, um das Programm kürzer zu machen." #. type: ScriptName-text #: ../scene.txt:3 #, no-wrap msgid "Move" msgstr "Funktion1" #. type: \b; header #: ../help/help.E.txt:1 #, no-wrap msgid "Exercise" msgstr "Übung" #. type: Plain text #: ../help/help.E.txt:2 #, no-wrap msgid "The bot must pass over all the blue crosses on the ground. The way that must be covered is made of two squares. The first one measures 15 meters, the second 25 meters." msgstr "Der Roboter soll alle blauen Kreuze auf dem Boden passieren. Der Weg, der genommen werden muss, besteht aus zwei Quadraten. Das erste misst 15 Meter, das zweite 25 Meter." #. type: Image filename #: ../help/help.E.txt:4 #, no-wrap msgid "tproc1a" msgstr "tproc1a" #. type: \b; header #: ../help/help.E.txt:5 #, no-wrap msgid "General principle" msgstr "Vorgehensweise" #. type: Plain text #: ../help/help.E.txt:6 #, no-wrap msgid "In order to solve this problem, the most efficient solution consists in creating a function that instructs the bot to move on a square shape of a certain size. The main program becomes then very simple:" msgstr "Der effizienteste Weg, dieses Problem zu lösen, besteht darin, eine Funktion zu erzeugen, die den Roboter anweist, ein Quadrat mit einer bestimmten Kantenlänge zu fahren. Das Hauptprogramm wird dann ziemlich einfach:" #. type: Source code #: ../help/help.E.txt:7 #, no-wrap msgid "" "extern void object::Function1( )\n" "{\n" "\tSquare(15);\n" "\tSquare(25);\n" "}" msgstr "" "extern void object::Funktion1( )\n" "{\n" "\tSquare(15);\n" "\tSquare(25);\n" "}" #. type: Plain text #: ../help/help.E.txt:13 #, no-wrap msgid "You still have to define the function called Square. In order to do this, you will have to write some instructions outside the block that until now was the frame of each one of your programs. At the very end of the program, after the last closing brace, we will define the function Square. The program will take the following shape:" msgstr "Sie müssen immer noch die Funktion namens Square definieren. Um dies zu tun, müssen Sie einige Anweisungen außerhalb des Blocks schreiben, der bis jetzt immer den Rahmen aller Ihrer Programme gebildet hat. Ganz am Ende des Programmes, hinter der letzten schließenden Klammer werden wir die Funktion Square definieren. Das Programm nimmt folgende Form an:" #. type: Source code #: ../help/help.E.txt:15 #, no-wrap msgid "" "extern void object::Function1( )\n" "{\n" "\tmain function ...\n" "}\n" "\n" "void object::Square(float length)\n" "{\n" "\tnew function ...\n" "}" msgstr "" "extern void object::Funktion1( )\n" "{\n" "\tHaupt-Funktion ...\n" "}\n" "\n" "void object::Square(float length)\n" "{\n" "\tneue Funktion ...\n" "}" #. type: Plain text #: ../help/help.E.txt:25 #, no-wrap msgid "Let us look in detail at the different elements of the declaration of the function Square:" msgstr "Nehmen wir einmal die verschiedenen Elemente der Deklaration der Funktion Square unter die Lupe:" #. type: Plain text #: ../help/help.E.txt:27 #, no-wrap msgid "" "void\n" "This means that this function will return no value." msgstr "" "void\n" "Dies bedeutet, dass die Funktion kein Ergebnis zurückliefert." #. type: Plain text #: ../help/help.E.txt:30 #, no-wrap msgid "" "object::\n" "When you write this in front of the function name, you can have access in the function to all the characteristics of the bot, such as position, orientation, etc. In this exercise, this element is not compulsory, as we will not need the characteristics of the bot in the function." msgstr "" "object::\n" "Wenn Sie dies vor den Namen der Funktion schreiben, dann haben Sie innerhalb der Funktion Zugriff auf alle Eigenschaften des Roboters wie zum Beispiel position, orientation, usw. In dieser Übung ist dieses Element nicht zwingend notwendig, da wir diese Eigenschaften des Roboters nicht benötigen werden." #. type: Plain text #: ../help/help.E.txt:33 #, no-wrap msgid "" "Square ( )\n" "This is the name of the function. You can call it Square, or any other name." msgstr "" "Square ( )\n" "Dies ist der Name der Funktion. Sie können sie \"Square\" nennen, oder auch ganz anders." #. type: Plain text #: ../help/help.E.txt:36 #, no-wrap msgid "" "float length\n" "Here you define the parameters that the function will get when it is called. The first time the function is actually called with Square(15), the variable length will contain the value 15. The second time, length will contain 25." msgstr "" "float length\n" "Hier definieren Sie die Parameter, die die Funktion erhält, wenn sie aufgerufen wird. Wenn die Funktion das erste mal mit Square(15) wirklich aufgerufen wird, enthält die Variable length den Wert 15. Beim zweiten Mal enthält length den Wert 25." #. type: Plain text #: ../help/help.E.txt:39 #, no-wrap msgid "Here is in detail what will happen when the program is executed:" msgstr "Im Detail passiert folgendes, wenn das Programm ausgeführt wird:" #. type: Bullet: '-' #: ../help/help.E.txt:40 #, no-wrap msgid "First the main function Function will be executed." msgstr "Zuerst wird die Hauptfunktion Funktion1 ausgeführt." #. type: Bullet: '-' #: ../help/help.E.txt:41 #, no-wrap msgid "At the line Square(15), the program will follow the red arrow and enter the function Square a first time, length containing 15." msgstr "In der Zeile Square(15) folgt das Programm dem roten Pfeil und beginnt erstmalig mit der Ausführung der Funktion Square; length enthält dabei 15." #. type: Bullet: '-' #: ../help/help.E.txt:42 #, no-wrap msgid "At the end of the function Square, the program follows the orange arrow and comes back to the main function." msgstr "Am Ende der Funktion Square folgt das Programm dem orangen Pfeil und kehrt so zur Hauptfunktion zurück. " #. type: Bullet: '-' #: ../help/help.E.txt:43 #, no-wrap msgid "At the line Square(25), the program will follow the blue arrow and enter the function Square a second time." msgstr "In der Zeile Square(25) folgt das Programm dem blauen Pfeil und beginnt zum zweiten Mal mit der Ausführung der Funktion Square." #. type: Bullet: '-' #: ../help/help.E.txt:44 #, no-wrap msgid "At the end of the function Square, the program follows the light blue arrow and comes back to the main function." msgstr "Am Ende der Funktion Square folgt das Programm dem orangen Pfeil und kehrt so zur Hauptfunktion zurück. " #. type: Image filename #: ../help/help.E.txt:46 #, no-wrap msgid "tproc1b" msgstr "tproc1b" #. type: Plain text #: ../help/help.E.txt:47 #, no-wrap msgid "In the function Square, use the instructions move and turn. In order to make it shorter, you can use a for loop, that will repeat the instructions move and turn 4 times; however, this is not compulsory." msgstr "Benutzen Sie in der Funktion Square die Anweisungen move und turn. Um sie kürzer zu gestalten, können Sie eine for-Schleife benutzen, welche die Anweisungen move und turn jeweils 4 mal ausführt; aber auch das ist nicht zwingend notwendig." #. type: Source code #: ../help/help.E.txt:49 #, no-wrap msgid "" "void object::Square(float length)\n" "{\n" "\tfor ( int i=0 ; i<4 ; i=i+1 )\n" "\t{\n" "\t\tmove(length);\n" "\t\tturn(90);\n" "\t}\n" "}" msgstr "" "void object::Square(float length)\n" "{\n" "\tfor ( int i=0 ; i<4 ; i=i+1 )\n" "\t{\n" "\t\tmove(length);\n" "\t\tturn(90);\n" "\t}\n" "}" #. type: \t; header #: ../help/help.E.txt:58 #, no-wrap msgid "See also" msgstr "Siehe auch" #. type: Plain text #: ../help/help.E.txt:59 #, no-wrap msgid "Programming, types and categories." msgstr "Die CBOT-Sprache, die Variablentypen und die Kategorien."