# 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" "POT-Creation-Date: 2014-07-02 12:51+0200\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 #: train601.languagecode:1 #, no-wrap msgid "E" msgstr "P" #. type: Title-text #: train601/scene.txt:1 #, no-wrap msgid "train601:A function" msgstr "train601:Funkcja" #. type: Resume-text #: train601/scene.txt:2 #, no-wrap msgid "train601:Create a function in order to make your program shorter." msgstr "train601:Utwórz funkcję, która pozwoli skrócić Twój program." #. type: ScriptName-text #: train601/scene.txt:3 #, no-wrap msgid "train601:Move" msgstr "train601:Poruszanie" #. type: \b; header #: train601-help/tproc1.txt:1 #, no-wrap msgid "Exercise" msgstr "Ćwiczenie" #. type: Plain text #: train601-help/tproc1.txt:3 #, 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 "Robot musi przejść przez wszystkie niebieskie plusy leżące na ziemi. Droga, którą musi pokonać, składa się z dwóch kwadratów. Pierwszy ma bok równy 15 metrów a drugi, 25 metrów." #. type: Image filename #: train601-help/tproc1.txt:4 #, no-wrap msgid "tproc1a" msgstr "tproc1a" #. type: \b; header #: train601-help/tproc1.txt:5 #, no-wrap msgid "General principle" msgstr "Ogólny algorytm" #. type: Plain text #: train601-help/tproc1.txt:7 #, 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 "Najbardziej efektywne rozwiązanie tego problemu polega na napisaniu funkcji, która porusza robotem po kwadracie określonego rozmiaru. Główny program staje się wtedy bardzo prosty:" #. type: \s; block (usually verbatim code) #: train601-help/tproc1.txt:12 #, no-wrap msgid "" "extern void object::Function1( )\n" "{\n" "\tSquare(15);\n" "\tSquare(25);\n" "}" msgstr "" "extern void object::Funkcja1( )\n" "{\n" "\tKwadrat(15);\n" "\tKwadrat(25);\n" "}" #. type: Plain text #: train601-help/tproc1.txt:14 #, 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 "Wciąż jednak należy zdefiniować funkcję nazwaną Kwadrat. Aby to zrobić, konieczne będzie napisanie kilku instrukcji poza blokiem który dotychczas był ramką dla każdego z Twoich programów. Na samym końcu programu, po ostatniej klamrze zamykającej, należy zdefiniować funkcję Kwadrat. Program będzie wyglądał następująco:" #. type: \s; block (usually verbatim code) #: train601-help/tproc1.txt:24 #, 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::Funkcja1( )\n" "{\n" "\tgłówna funkcja...\n" "}\n" "\n" "void object::Kwadrat(float bok)\n" "{\n" "\tnowa funkcja...\n" "}" #. type: Plain text #: train601-help/tproc1.txt:26 #, no-wrap msgid "Let us look in detail at the different elements of the declaration of the function Square:" msgstr "Przyjrzyjmy się uważniej różnym elementom deklaracji funkcji Kwadrat:" #. type: Plain text #: train601-help/tproc1.txt:29 #, no-wrap msgid "" "void\n" "This means that this function will return no value." msgstr "" "void\n" "Oznacza, że ta funkcja nie zwraca żadnej wartości." #. type: Plain text #: train601-help/tproc1.txt:32 #, 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" "Napisanie tego przed nazwą funkcji oznacza, że będzie ona miała dostęp do wszystkich charakterystyk robota, takich jak position, orientation, itd. W tym ćwiczeniu element ten nie jest wymagany, jako że w funkcji nie będą potrzebne charakterystyki robota." #. type: Plain text #: train601-help/tproc1.txt:35 #, no-wrap msgid "" "Square ( )\n" "This is the name of the function. You can call it Square, or any other name." msgstr "" "Kwadrat ( )\n" "To jest nazwa funkcji. Możesz ją nazwać Kwadrat lub dowolnie inaczej." #. type: Plain text #: train601-help/tproc1.txt:38 #, 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 bok\n" "Tutaj definiujesz parametry, które otrzymuje funkcja podczas wywołania. Przy pierwszym wywołaniu funkcji Kwadrat(15), zmienna bok będzie miała wartość 15. Za drugim razem bok będzie równy 25." #. type: Plain text #: train601-help/tproc1.txt:40 #, no-wrap msgid "Here is in detail what will happen when the program is executed:\n" msgstr "Oto szczegóły tego co zdarzy się po wykonaniu programu:\n" #. type: Bullet: '-' #: train601-help/tproc1.txt:40 #, no-wrap msgid "First the main function Function will be executed." msgstr "Najpierw uruchamiana jest główna funkcja Funkcja1." #. type: Bullet: '-' #: train601-help/tproc1.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 "W wierszu Kwadrat(15), program podąży za czerwoną strzałką i przejdzie do funkcji Kwadrat po raz pierwszy, bok równy 15." #. type: Bullet: '-' #: train601-help/tproc1.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 "Na końcu funkcji Kwadrat, program podąży za pomarańczową strzałką i wróci do funkcji głównej." #. type: Bullet: '-' #: train601-help/tproc1.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 "W wierszu Kwadrat(25), program podąży za niebieską strzałką, przechodząc po raz drugi do funkcji Kwadrat." #. type: Bullet: '-' #: train601-help/tproc1.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 "Na końcu funkcji Kwadrat, program podąży za jasno niebieską strzałką i wróci do funkcji głównej." #. type: Image filename #: train601-help/tproc1.txt:46 #, no-wrap msgid "tproc1b" msgstr "tproc1b" #. type: Plain text #: train601-help/tproc1.txt:48 #, 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 "W funkcji Kwadrat, użyj instrukcji move i turn. Aby skrócić program możesz użyć pętli for, która powtórzy 4 razy instrukcje move i turn, nie jest to jednak niezbędne." #. type: \s; block (usually verbatim code) #: train601-help/tproc1.txt:57 #, 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::Kwadrat(float bok)\n" "{\n" "\tfor ( int i=0 ; i<4 ; i=i+1 )\n" "\t{\n" "\t\tmove(bok);\n" "\t\tturn(90);\n" "\t}\n" "}" #. type: \t; header #: train601-help/tproc1.txt:58 #, no-wrap msgid "See also" msgstr "Zobacz również" #. type: Plain text #: train601-help/tproc1.txt:59 #, no-wrap msgid "Programming, types and categories." msgstr "Programowanie, typy i kategorie."