diff --git a/cs-CZ/code/target-practice-solution/main.py b/cs-CZ/code/target-practice-solution/main.py new file mode 100644 index 000000000..e88fb95de --- /dev/null +++ b/cs-CZ/code/target-practice-solution/main.py @@ -0,0 +1,55 @@ +## Import kódu knihovny + +from p5 import * +from random import randint + + +# Zde je funkce mouse_pressed +def mouse_pressed(): + # print('🎯') + if hit_colour == Color("modrá").hex: + print("Trefil jsi vnější kruh, 50 bodů!") + elif hit_colour == Color("červená").hex: + print("Trefil jsi vnitřní kruh, 200 bodů!") + elif hit_colour == Color("žlutá").hex: + print("Trefil jsi střed, 500 bodů!") + else: + print("Vedle! Žádné body!") + + +# Zde je funkce shoot_arrow +def shoot_arrow(): + global hit_colour + arrow_x = randint(100, 300) + arrow_y = randint(100, 300) + hit_colour = get(arrow_x, arrow_y).hex + # print(hit_colour) + fill("brown") + circle(arrow_x, arrow_y, 15) + + +def setup(): + # Zde si nastav svou hru + size(400, 400) + no_stroke() + + +def draw(): + # Co dělat v každém snímku + fill("cyan") + rect(0, 0, 400, 250) + fill("lightgreen") + rect(0, 250, 400, 150) + fill("brown") + triangle(150, 350, 200, 150, 250, 350) + fill("blue") + circle(200, 200, 170) + fill("red") + circle(200, 200, 110) # Nakresli vnitřní kruh + fill("yellow") + circle(200, 200, 30) # Nakresli prostřední kruh + shoot_arrow() + + +# Toto si ponech pro spuštění kódu +run(frame_rate=2) diff --git a/cs-CZ/code/target-practice-solution/project_config.yml b/cs-CZ/code/target-practice-solution/project_config.yml new file mode 100644 index 000000000..c300c685b --- /dev/null +++ b/cs-CZ/code/target-practice-solution/project_config.yml @@ -0,0 +1,3 @@ +name: 'Cílové příklady procvičování' +identifier: 'target-practice-solution' +type: 'python' diff --git a/cs-CZ/code/target-practice-starter/main.py b/cs-CZ/code/target-practice-starter/main.py new file mode 100644 index 000000000..4ae5dcba6 --- /dev/null +++ b/cs-CZ/code/target-practice-starter/main.py @@ -0,0 +1,24 @@ +## Import kódu knihovny +from p5 import * +from random import randint + +# Zde je funkce mouse_pressed + + +# Zde je funkce shoot_arrow + + +def setup(): + # Zde si nastav svou hru + size(400, 400) + no_stroke() + + +def draw(): + # Co dělat v každém snímku + fill("cyan") + rect(0, 0, 400, 250) + + +# Toto si ponech pro spuštění kódu +run(frame_rate=2) diff --git a/cs-CZ/code/target-practice-starter/project_config.yml b/cs-CZ/code/target-practice-starter/project_config.yml new file mode 100644 index 000000000..a857ca082 --- /dev/null +++ b/cs-CZ/code/target-practice-starter/project_config.yml @@ -0,0 +1,3 @@ +name: "Cílové procvičování" +identifier: 'target-practice-starter' +type: 'python' diff --git a/cs-CZ/images/alternative-colours.png b/cs-CZ/images/alternative-colours.png new file mode 100644 index 000000000..e630dd54b Binary files /dev/null and b/cs-CZ/images/alternative-colours.png differ diff --git a/cs-CZ/images/arrow-centre.png b/cs-CZ/images/arrow-centre.png new file mode 100644 index 000000000..14dba17ee Binary files /dev/null and b/cs-CZ/images/arrow-centre.png differ diff --git a/cs-CZ/images/background.png b/cs-CZ/images/background.png new file mode 100644 index 000000000..7d2a272de Binary files /dev/null and b/cs-CZ/images/background.png differ diff --git a/cs-CZ/images/banner.png b/cs-CZ/images/banner.png new file mode 100644 index 000000000..ddd9a5786 Binary files /dev/null and b/cs-CZ/images/banner.png differ diff --git a/cs-CZ/images/blue-circle.png b/cs-CZ/images/blue-circle.png new file mode 100644 index 000000000..054b612e8 Binary files /dev/null and b/cs-CZ/images/blue-circle.png differ diff --git a/cs-CZ/images/blue-points.png b/cs-CZ/images/blue-points.png new file mode 100644 index 000000000..921b62ff2 Binary files /dev/null and b/cs-CZ/images/blue-points.png differ diff --git a/cs-CZ/images/blue_circle_points.gif b/cs-CZ/images/blue_circle_points.gif new file mode 100644 index 000000000..8ab59627f Binary files /dev/null and b/cs-CZ/images/blue_circle_points.gif differ diff --git a/cs-CZ/images/bottom-right.png b/cs-CZ/images/bottom-right.png new file mode 100644 index 000000000..2c4fb9e43 Binary files /dev/null and b/cs-CZ/images/bottom-right.png differ diff --git a/cs-CZ/images/centre.png b/cs-CZ/images/centre.png new file mode 100644 index 000000000..1ce8e6fc4 Binary files /dev/null and b/cs-CZ/images/centre.png differ diff --git a/cs-CZ/images/circle-coords.png b/cs-CZ/images/circle-coords.png new file mode 100644 index 000000000..a888286e1 Binary files /dev/null and b/cs-CZ/images/circle-coords.png differ diff --git a/cs-CZ/images/fire_arrow.gif b/cs-CZ/images/fire_arrow.gif new file mode 100644 index 000000000..924ba34af Binary files /dev/null and b/cs-CZ/images/fire_arrow.gif differ diff --git a/cs-CZ/images/green-grass.png b/cs-CZ/images/green-grass.png new file mode 100644 index 000000000..8c7f5794e Binary files /dev/null and b/cs-CZ/images/green-grass.png differ diff --git a/cs-CZ/images/missed_no_points.gif b/cs-CZ/images/missed_no_points.gif new file mode 100644 index 000000000..8ab59627f Binary files /dev/null and b/cs-CZ/images/missed_no_points.gif differ diff --git a/cs-CZ/images/points-scored.gif b/cs-CZ/images/points-scored.gif new file mode 100644 index 000000000..8ab59627f Binary files /dev/null and b/cs-CZ/images/points-scored.gif differ diff --git a/cs-CZ/images/quiz-colour.png b/cs-CZ/images/quiz-colour.png new file mode 100644 index 000000000..e6012953c Binary files /dev/null and b/cs-CZ/images/quiz-colour.png differ diff --git a/cs-CZ/images/random-side.png b/cs-CZ/images/random-side.png new file mode 100644 index 000000000..212ea6368 Binary files /dev/null and b/cs-CZ/images/random-side.png differ diff --git a/cs-CZ/images/showcase_rocket.png b/cs-CZ/images/showcase_rocket.png new file mode 100644 index 000000000..6586fe933 Binary files /dev/null and b/cs-CZ/images/showcase_rocket.png differ diff --git a/cs-CZ/images/sky_stroke.png b/cs-CZ/images/sky_stroke.png new file mode 100644 index 000000000..347018cb5 Binary files /dev/null and b/cs-CZ/images/sky_stroke.png differ diff --git a/cs-CZ/images/stand_coords.png b/cs-CZ/images/stand_coords.png new file mode 100644 index 000000000..2002bae5f Binary files /dev/null and b/cs-CZ/images/stand_coords.png differ diff --git a/cs-CZ/images/target-stand.png b/cs-CZ/images/target-stand.png new file mode 100644 index 000000000..c65d89363 Binary files /dev/null and b/cs-CZ/images/target-stand.png differ diff --git a/cs-CZ/images/target_area.png b/cs-CZ/images/target_area.png new file mode 100644 index 000000000..1e5c72120 Binary files /dev/null and b/cs-CZ/images/target_area.png differ diff --git a/cs-CZ/images/target_printed.gif b/cs-CZ/images/target_printed.gif new file mode 100644 index 000000000..b29a244fe Binary files /dev/null and b/cs-CZ/images/target_printed.gif differ diff --git a/cs-CZ/images/three-circles.png b/cs-CZ/images/three-circles.png new file mode 100644 index 000000000..13a8dd8ed Binary files /dev/null and b/cs-CZ/images/three-circles.png differ diff --git a/cs-CZ/images/top-left.png b/cs-CZ/images/top-left.png new file mode 100644 index 000000000..3cb3e458f Binary files /dev/null and b/cs-CZ/images/top-left.png differ diff --git a/cs-CZ/images/upgrade-ideas.png b/cs-CZ/images/upgrade-ideas.png new file mode 100644 index 000000000..083f82320 Binary files /dev/null and b/cs-CZ/images/upgrade-ideas.png differ diff --git a/cs-CZ/images/yellow-points.png b/cs-CZ/images/yellow-points.png new file mode 100644 index 000000000..4c265e182 Binary files /dev/null and b/cs-CZ/images/yellow-points.png differ diff --git a/cs-CZ/meta.yml b/cs-CZ/meta.yml new file mode 100644 index 000000000..2c3b8e99d --- /dev/null +++ b/cs-CZ/meta.yml @@ -0,0 +1,32 @@ +--- +title: Cílová praxe +hero_image: images/banner.png +description: Použij Python k nakreslení cíle a získej body tím, že do něj zasáhneš šípy +meta_title: Projekty kódování Python pro děti a dospívající | Cílová praxe +meta_description: Nauč se Python s projekty kódování pro děti a dospívající nadace Raspberry Pi Foundation. Použij Python k nakreslení cíle a zaznamenávej body tím, že ho zasáhneš šípy. +version: 4 +listed: true +copyedit: true +last_tested: "2021-10-06" +steps: + - title: Co budeš dělat + - title: Nakresli trávu + - title: Nakresli svůj cíl + completion: + - engaged + - title: Přidej šíp + - title: Jakou barvu jsi trefil? + - title: Získej body + completion: + - internal + - title: Rychlý kvíz + knowledge_quiz: + path: quiz1 + version: 1 + questions: 3 + passing_score: 3 + completion: + - external + - title: Výzva + challenge: true + - title: Co můžeš dělat dál? diff --git a/cs-CZ/python-comments.txt b/cs-CZ/python-comments.txt new file mode 100644 index 000000000..607c4f841 --- /dev/null +++ b/cs-CZ/python-comments.txt @@ -0,0 +1,27 @@ +Co dělat v každém snímku + +Nakreslete vnitřní kruh + +Nakreslete střední kruh + +Zde je funkce shoot_arrow + +Zde je funkce mouse_pressed + +Trefil jsi vnější kruh, 50 bodů! + +Trefil jsi vnitřní kruh, 200 bodů! + +Trefil jsi střed, 500 bodů! + +Trefil jsi střed, 500 bodů! + +Netrefil jsi! Bez bodů! + +Super rychlé + +Docela rychle + +Velmi rychle + +Rychlost nebyla rozpoznána! \ No newline at end of file diff --git a/cs-CZ/python-translatable.txt b/cs-CZ/python-translatable.txt new file mode 100644 index 000000000..1e4f01f6b --- /dev/null +++ b/cs-CZ/python-translatable.txt @@ -0,0 +1,9 @@ +shoot_arrow + +arrow_x + +arrow_y + +hit_colour + +speed \ No newline at end of file diff --git a/cs-CZ/quiz1/question_1.md b/cs-CZ/quiz1/question_1.md new file mode 100644 index 000000000..ca0fc5568 --- /dev/null +++ b/cs-CZ/quiz1/question_1.md @@ -0,0 +1,63 @@ +## Rychlý kvíz + +Odpovězte na tři otázky. Existují tipy, které vás dovedou ke správné odpovědi. + +Po zodpovězení každé otázky klikněte na **Zkontrolujte moji odpověď**. + +Příjemnou zábavu! + +--- question --- +--- +legend: Otázka 1 ze 3 +--- +Ve svém projektu jsi přidal `randint(100, 300)` do funkce `shoot_arrow()`. Co dělá `randint(100, 300)`? + +--- code --- +--- +language: python +--- + +def shoot_arrow(): + global hit_colour + arrow_x = randint(100, 300) + arrow_y = randint(100, 300) + +--- /code --- + +--- choices --- + +- (x) Vybere náhodné celé číslo mezi 100 a 300. + + --- feedback --- + +Správně. Tím vyberete náhodnou souřadnici x pro vaši šipku. + + --- /feedback --- + +- ( ) Způsobí, že se šipka náhodně pohybuje po obrazovce. + + --- feedback --- + +Ne tak docela. Tento kód je součástí toho, jak se šipka pohybuje náhodně, ale k dosažení tohoto cíle potřebujete také jiný kód. + + --- /feedback --- + +- () Získá barvu, kterou zasáhla šipka. + + --- feedback --- + + Ne tak docela. K získání barvy by se použila funkce get(). + + --- /feedback --- + +- ( ) Nakreslí kruh náhodné velikosti. + + --- feedback --- + + Ne tak docela. K nakreslení kruhu lze použít funkci circle(). + + --- /feedback --- + +--- /choices --- + +--- /question --- diff --git a/cs-CZ/quiz1/question_2.md b/cs-CZ/quiz1/question_2.md new file mode 100644 index 000000000..0735356a5 --- /dev/null +++ b/cs-CZ/quiz1/question_2.md @@ -0,0 +1,56 @@ + +--- question --- +--- +legend: Otázka 2 ze 3 +--- + +Ve svém projektu jsi použil `if` , `elif` and `else` , abys zkontroloval, na kterou barvu šipka přistála. + +V níže uvedeném příkladu má proměnná s názvem `speed` uloženu hodnotu `6`. Když je spuštěn příkaz `if`, co se vytiskne ve výstupní oblasti? + +--- code --- +--- +language: python +--- +speed = 6 + +if speed == 7: + print('Super rychlá') +elif speed == 5: + print('Docela rychlá') +elif speed == 6: + print('Velmi rychlá') +else: + print('Rychlost nebyla rozpoznána!') + +--- /code --- + +--- choices --- + +- (x) `Velmi rychlá` + + --- feedback --- + + Správně! Proměnné **speed** byla přiřazena hodnota `6`. Podmínka `speed == 6` bude vyhodnocena jako **True** a tím pádem bude vytisknuto `Velmi rychlá`. + + --- /feedback --- + +- ( ) `Rychlost nebyla rozpoznána!` + + --- feedback --- + + Ne tak docela. Podívej se na hodnotu přiřazenou proměnné **speed**. + + --- /feedback --- + +- ( ) Nic se nevytiskne + + --- feedback --- + + Zkus to znovu, `else` se použije jako poslední možnost, když jsou všechny výše uvedené podmínky nepravdivé. Prohlédni si znovu podmínky, jsou některé z podmínek pravdivé? + + --- /feedback --- + +--- /choices --- + +--- /question --- diff --git a/cs-CZ/quiz1/question_3.md b/cs-CZ/quiz1/question_3.md new file mode 100644 index 000000000..98fae0191 --- /dev/null +++ b/cs-CZ/quiz1/question_3.md @@ -0,0 +1,64 @@ + +--- question --- +--- +legend: Otázka 3 ze 3 +--- + +Kruh se nakreslí pomocí následujícího kódu: + +--- code --- +--- +language: python +--- + +def setup(): + size(400, 400) + fill(0, 255, 0) + no_stroke() + +def draw(): + circle(0, 0, 300) + +run() + +--- /code --- + +Který z obrázků níže ukazuje správnou polohu tohoto kruhu ve výstupní oblasti? + +--- choices --- + +- ( )  + + --- feedback --- + + Ne tak docela, pro vycentrování kruhu v pravém dolním rohu by souřadnice musely být stejné jako velikost obrazovky. V tomto příkladu by elipsa byla `circle(400, 400, 300)`. + + --- /feedback --- + +- ( )  + + --- feedback --- + + Ne tak docela, aby se kruh vycentroval na střed, souřadnice by musely být poloviční velikosti obrazovky. V tomto příkladu `circle(200, 200, 300)`. + + --- /feedback --- + +- (x)  + + --- feedback --- + + Správně! Tento kruh je vycentrován na souřadnicích (0,0), v levém horním rohu obrazovky. + + --- /feedback --- + +- ( )  + + --- feedback --- + + Ne, tento kruh by měl kód `circle(350, 150, 300)`, aby byl vycentrován směrem k pravé horní části obrazovky. Souřadnice `x` udává, jak daleko přes obrazovku je elipsa, a souřadnice `y` je, jak daleko je na obrazovce. + + --- /feedback --- + +--- /choices --- + +--- /question --- diff --git a/cs-CZ/resources/.keep b/cs-CZ/resources/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/cs-CZ/resources/Target Practice.zip b/cs-CZ/resources/Target Practice.zip new file mode 100644 index 000000000..d2ac42019 Binary files /dev/null and b/cs-CZ/resources/Target Practice.zip differ diff --git a/cs-CZ/solutions/.keep b/cs-CZ/solutions/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/cs-CZ/solutions/Target Practice.zip b/cs-CZ/solutions/Target Practice.zip new file mode 100644 index 000000000..7f372e7c0 Binary files /dev/null and b/cs-CZ/solutions/Target Practice.zip differ diff --git a/cs-CZ/step_1.md b/cs-CZ/step_1.md new file mode 100644 index 000000000..c8531daa4 --- /dev/null +++ b/cs-CZ/step_1.md @@ -0,0 +1,29 @@ +## Co budeš dělat + +Použijte Python k nakreslení cíle a získejte body tím, že do něj zasáhnete šipkami. + +--- print-only --- + +{:width="640px"} + +--- /print-only --- + +--- no-print --- +