Jump to content

Wikifunkcie:Inštrukcie

From Wikifunctions
This page is a translated version of the page Wikifunctions:Introduction and the translation is 53% complete.
Outdated translations are marked like this.

Funkcie sú počítačové inštrukcie, ktoré robia výpočty na základe údajov, ktoré poskytnete, a odpovedajú na otázky, ktoré máte o nich. Napríklad, keď sa spýtate hlasového asistentov, koľko míľ ma kilometer, hlasový asistent zavolá funkciu, ktorá to pre vás vypočíta.

Wikifunkcie je projekt s otvoreným zdrojom, ktorý umožňuje každému vytvárať funkcie a zdieľať ich pre ostatných, aby ich mohli používať, remixovať, testovať a učiť sa.

Pomocou nasledujúcich návodov si vyskúšajte základné funkcie Wikifunkcií. Tešíme sa na vašu spätnú väzbu a príspevky!

Vyhodnotenie funkcie

Môžete si sami vyskúšať funkcie prispievané komunitou vo Wikifunkciách! Vyberte si jednu z našej knižnice funkcií a zadajte vstupné hodnoty na zistenie výstupu.

Kroky:

  1. Najdite si funkciu na Hlavnej stránke.
  2. Prejdite na stránku funkcie.
  3. Zadajte vstupné hodnoty.
  4. Spustíte funkciu.

Výsledky:

  1. Bol výstup taký, aký ste očakávali?
  2. Chcete nahlásiť spätnú väzbu alebo nejaké úpravy?

Vytvorenie funkcie

Môžete pridať svoje vlastné funkcie na Wikifunkciách! Vytvorte novú funkciu na použitie vo vlastných implementáciách a umožnite ju využívať aj iným. Nové funkcie sa môžu písať v jazyku, ktorý si želáte.

Kroky:

  1. Prejdite na stránku pre vytvorenie funkcie.
  2. Meno vašej funkcie.
  3. Definovanie vstupu pre vašu funkciu:
    1. Pridanie/odstránenie vstupných položiek.
    2. Definovanie každého typu vstupu.
    3. Pomenovanie každého vstupu.
  4. Definovanie výstupu pre vašu funkciu:
  5. Nepovinne, pre ktorékoľvek z týchto polí uveďte viacjazyčné hodnoty:
    • Názov funkcie, aliasy funkcie, vstupné položky.
  6. Zverejnite vašu funkciu

Výsledky:

  1. Bola funkcia úspešne uložená?
  2. Chcete nahlásiť spätnú väzbu alebo nejaké úpravy?

Editovanie funkcie

Do Wikifunkcií môžete prispievať úpravou knižnice funkcií. Pridajte alebo upravte viacjazyčné informácie funkcií a rozšírte a upravte definície funkcií.

Kroky:

  1. Najdite si funkciu na Hlavnej stránke.
  2. Prejdite na stránku funkcie.
  3. Kliknutím na Upraviť zdroj zobrazíte možnosti úprav pre túto funkciu.
  4. Voliteľne, úprava hodnôt:
    1. Meno funkcie,
    2. Aliasy funkcie
    3. Zoznam vstupov
      1. Pridanie/odstránenie vstupných položiek.
      2. Editovanie typu vstupu
      3. Editovanie vstupných položiek
    4. Typ výstupu.
  5. Nepovinne, pre ktorékoľvek z týchto polí uveďte viacjazyčné hodnoty:
    1. Meno funkcie
    2. Aliasy funkcie
    3. Vstupne položky.
  6. Zverejnenie vašich zmien.

Výsledky:

  1. Boli vaše zmeny úspešne uložené?
  2. Chcete nahlásiť spätnú väzbu alebo nejaké úpravy?

Create tests

You can create tests for your function implementations in Wikifunctions to ensure they are working properly.

Steps:

  1. Find a function on the Main Page or the function you created in the previous workflow.
  2. Navigate to the function page.
  3. Click the “+” link in the tests table.
  4. Click on "Select Funkce" under "Call".
    1. In the field under "Function", type in the name of the function you are testing and select the function when it shows up.
    2. Add values for the inputs in the respective fields.
  5. Click on "Select Funkce" under "Result Validation". In the field under "Function", type in the name of the function you want to use to check the result.
    • For a function whose output is String, this will be "String equality", for a function whose output is Boolean, this will be "Boolean equality".
    • Add the expected value in the given field (either "Second String" or "Second Boolean").
  6. Publish your updates.

Results:

  1. Was the test successfully published?
  2. Do you have corrections or feedback to report?

Create an implementation

Functions are brought to life in implementations created to suit your needs. Run, remix, and combine functions via implementations in Wikifunctions. See the section below to learn how to connect your implementation to functions. We recommend creating and connecting a test before creating an implementation. A more comprehensive guide to creating implementations is available at Wikifunctions:How to create implementations.

Steps:

  1. Find a function on the Main Page.
  2. Navigate to the function page.
  3. Click the “+” link in the implementations table.
  4. You can create a new implementation in one of two ways:
    1. Code
      • Select the required programming language to write the function code.
      • Input your code.
    2. Composition:
      • Create a composition using existing functions.
  5. Publish your updates (after running a test by clicking the round arrow on the right of the box titled Testovací případy).

Results:

  1. Was the implementation successfully published?
  2. Do you have corrections or feedback to report?

Connect an Implementation or Test to a Function

Note: This feature is only available to Functioneers.

Connect tests and implementations to your function to see it come to life.

Steps:

  1. Find a function on the Main Page.
  2. Navigate to the function page.
  3. Select one or more tests, or one or more implementations.
  4. Click on the button “Schválit”.

Results:

  1. Was the Schválený/Deaktivovaný state successfully changed?
  2. Do you have corrections or feedback to report?