Skip to content

Commit

Permalink
Merge branch 'main' into update-teachers-manual
Browse files Browse the repository at this point in the history
  • Loading branch information
boryanagoncharenko authored Feb 23, 2025
2 parents 9169c4d + 07b04f8 commit 18a1235
Show file tree
Hide file tree
Showing 17 changed files with 2,288 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ repos:
hooks:
- id: autopep8
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
rev: 7.1.2
hooks:
- id: flake8
5 changes: 3 additions & 2 deletions content/adventures/cs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ adventures:
Na této úrovni můžete použít více řádků ve vašich `{if}` příkazech, tímto způsobem můžete vylepšit svůj šťastný nebo smutný konec!
### Cvičení 1
Ukázkový kód zobrazuje dva různé konce; jeden, kde postavy skočí do stroje času, a druhý, kde to neudělají. Doplňte mezery alespoň jednou větou na každý konec.
Ukázkový kód zobrazuje dva různé konce; jeden, kde postavy skočí do stroje času, a druhý, kde to neudělají.
Doplňte mezery alespoň jednou větou na každý konec.
**Extra** Udělejte příběh delší. Co se v příběhu stane? Můžete také přidat druhý `{ask}` s různými možnostmi.
### Cvičení 2
Expand Down Expand Up @@ -260,7 +261,7 @@ adventures:
12:
story_text: Hedy doteď neumožňovala používat čísla s desetinami jako je 1.5, ale odteď už ano. Pozor, Hedy používá desetinnou tečku `.` namísto desetinné čárky.

example_code: "```\nburger = 5\nnápoj = 2\ncelkem = hamburger + nápoj\nprint 'Objednali jste si hamburger a nápoj'\nprint 'To stojí ' celkem ' dolarů, prosím'\n```\n"
example_code: "```\nburger = 5\nnápoj = 2\ncelkem = burger + nápoj\n{print} 'Objednali jste si hamburger a nápoj'\n{print} 'To stojí ' celkem ' dolarů, prosím'\n```\n"
13:
story_text: Teď se naučíme `and` (česky a) a `or` (nebo)! Když chceš ověřit dvě podmínky, nemusíš k tomu použít dva `if`y, ale stačí ti k tomu `and` a `or`. Pokud použiješ `and`, musí být obě podmínky, napravo i nalevo, pravdivé. S `or` stačí, aby byla pravdivá alespoň jedna z nich.
example_code: "```\nuživatelské_jméno = {ask} 'Jaké je vaše uživatelské jméno?'\nheslo = {ask} 'Jaké je vaše heslo?'\n{if} uživatelské_jméno {is} 'Hedy'\n {if} heslo {is} 'secret'\n {print} 'Vítejte Hedy!'\n {else}\n {print} 'Přístup odepřen'\n{else}\n {print} 'Přístup zamítnut!'\n```\n"
Expand Down
32 changes: 16 additions & 16 deletions content/adventures/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ adventures:
levels:
1:
story_text: |
## The ask command
## The `{ask}` command
Now that you can use the `{print}` command, you are ready to learn the next command: `{ask}`. With the `{ask}` command, you can ask a question. Check it out:
example_code: |
```
Expand All @@ -342,7 +342,7 @@ adventures:
```
2:
story_text: |
## The ask command
## The `{ask}` command
Now that we can use **variables** in our codes, we no longer need the `{echo}` command.
We can use variables to store the answers to our questions and this way we can use the answer to multiple questions in our codes.
Check it out:
Expand Down Expand Up @@ -1057,7 +1057,7 @@ adventures:
{print} 'Welcome to our restaurant'
people = {ask} 'How many people are in your party tonight?'
{for} i {in} {range} 0 {to} people
{call} greet_costumer
{call} greet_customer
```
13:
story_text: |-
Expand Down Expand Up @@ -1256,8 +1256,8 @@ adventures:
2:
story_text: |
Congratulations! You've reached level 2. Hopefully you've already made some awesome codes!
In the first level you might've notice that the `{echo}` command can only save one bit of information at a time.
For example in the restaurant adventure, you could echo what the costumer wanted to eat, or what they wanted to drink, but not both in one sentence.
In the first level you might have noticed that the `{echo}` command can only save one bit of information at a time.
For example in the restaurant adventure, you could echo what the customer wanted to eat, or what they wanted to drink, but not both in one sentence.
That changes in level 2. In level 2 you'll learn to work with variables, that allow you to save multiple pieces of information and print them in any place you want.
So let's go to the next adventure!
Expand Down Expand Up @@ -1398,7 +1398,7 @@ adventures:
```
13:
story_text: |
In the previous levels you've learned how to put two `{if}`commands inside each other. This works fine, but it does give you very long and unhandy codes like this one:
In the previous levels you've learned how to put two `{if}` commands inside each other. This works fine, but it does give you very long and unhandy codes like this one:
In this system you have to give both the correct username and the correct password.
In this level you will learn the `{and}` command that will make this code a lot shorter and more understandable!
Expand Down Expand Up @@ -1916,7 +1916,7 @@ adventures:
In this level you'll learn how to program the game MASH (mansion, apartment, shack, house). In this game you can predict for all the players at once, what their future will look like.
### Exercise
Fil in the blanks by using the new command that you've learned this level.
Fill in the blanks by using the new command that you've learned this level.
example_code: |
```
houses = mansion, apartment, shack, house
Expand Down Expand Up @@ -2880,7 +2880,7 @@ adventures:
Using the `{repeat}` command can make your codes for melodies a lot shorter!
### Exercise
Finish the code for Twinkle Twinkle Little Star by using the `{repeat}`command.
Finish the code for Twinkle Twinkle Little Star by using the `{repeat}` command.
Then go back to the songs you've made in the previous levels. Can you shorten those codes too?
example_code: |
```
Expand Down Expand Up @@ -3492,14 +3492,14 @@ adventures:
```
story_text_3: |
### Exercise
Try out the `{at} {random}` command by making your own gameshow (like the ones on tv) where you choose a door or suitcase and it contains a big price!
Try out the `{at} {random}` command by making your own gameshow (like the ones on tv) where you choose a door or suitcase and it contains a big prize!
Can you do it? We have already put the first lines into the example code.
example_code_3: |
```
{print} The big gameshow!
{print} There are 3 suitcases in front of you...
chosen {is} {ask} Which suitcase do you choose?
prices {is} _
prizes {is} _
_
```
16:
Expand Down Expand Up @@ -3626,8 +3626,8 @@ adventures:
Copy the example code into your input screen by clicking the yellow button.
Firstly, fill in the correct command on the blanks to make to code work properly.
Then add at least 4 more lines of code to the restaurant program.
Ask the costumer what they would like to drink and ask if they want to pay with cash or card.
Lastly, think of a nice way to say goodbye to your costumer.
Ask the customer what they would like to drink and ask if they want to pay with cash or card.
Lastly, think of a nice way to say goodbye to your customer.
example_code_2: |
```
{print} Welcome to Hedy's restaurant 🍟
Expand Down Expand Up @@ -3676,7 +3676,7 @@ adventures:
### Exercise
Now make your own version of the random restaurant.
Make a list of starts, mains, desserts, drinks and prices yourself.
Then use `{print}` and `{at} {random}` commands to tell the costumer what will be on their menu tonight.
Then use `{print}` and `{at} {random}` commands to tell the customer what will be on their menu tonight.
example_code_2: |
```
{print} Welcome to your own random restaurant!
Expand Down Expand Up @@ -3785,7 +3785,7 @@ adventures:
{print} 'Enjoy your meal!'
```
9:
story_text: "In this level you can use nesting to make your restaurant more realistic and more fun!\n\n### Exercise\nThe indentation was removed in the example code. \nCan you figure out how much indentation each line needs in order for the code to work properly?\nIf the customer orders pizza, Hedy shouldn't ask what sauce the costumer wants.\n\n**Extra** A restaurant does not stock all sauces. Make a list of available sauces and give a reply with each order whether you sell it. <br>\n**Extra** Pizzas have toppings. Ask customers what they want.<br>\n**Extra** Do customers want a drink? Ask them too! <br>\n"
story_text: "In this level you can use nesting to make your restaurant more realistic and more fun!\n\n### Exercise\nThe indentation was removed in the example code. \nCan you figure out how much indentation each line needs in order for the code to work properly?\nIf the customer orders pizza, Hedy shouldn't ask what sauce the customer wants.\n\n**Extra** A restaurant does not stock all sauces. Make a list of available sauces and give a reply with each order whether you sell it. <br>\n**Extra** Pizzas have toppings. Ask customers what they want.<br>\n**Extra** Do customers want a drink? Ask them too! <br>\n"
example_code: |
```
{print} 'Welcome to Restaurant Chez Hedy!'
Expand Down Expand Up @@ -3891,7 +3891,7 @@ adventures:
```
15:
story_text: |
With the `{while}` you can make sure your costumers can keep adding orders until they are done.
With the `{while}` you can make sure your customers can keep adding orders until they are done.
### Exercise
Correctly add the `{while}` command to this code.
Expand Down Expand Up @@ -4354,7 +4354,7 @@ adventures:
example_code: "```\nfamily = baby, mammy, daddy, grandma, grandpa\n_ _ _ _ \n {print} _\n```\n"
story_text_2: |
### Exercise 2
Print the song Five little moneys jumping on the bed. Look up the text if you don't remember.
Print the song Five little monkeys jumping on the bed. Look up the text if you don't remember.
**Extra** Print the song Old MacDonald had a farm, and make sure all animals make a different sound, using an `{if}`.
example_code_2: |
Expand Down
1 change: 1 addition & 0 deletions content/adventures/lt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion content/adventures/pt_BR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ adventures:
```
story_text_2: |
## {remove} {from}
Se você pode adicionar itens a uma lista, é claro que você também pode tirar. Isso é feito usando o comando `{remove} {from}`.
Se você pode adicionar itens a uma lista, é claro que você também pode retirá-los. Isso é feito usando o comando `{remove} {from}`.
example_code_2: |
```
animais {is} cachorro, gato, canguru
Expand Down
1 change: 1 addition & 0 deletions content/client-messages/lt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
67 changes: 67 additions & 0 deletions content/keywords/lt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
add: pridėti
ask: paklausti
and: ir
at: adresu
brown: rudas
call: iškviesti
clear: išvalyti
color: spalva
comma: ','
d1: '1'
d2: '2'
d3: '3'
d4: '4'
d6: '6'
def: apibrėžti
define: apibrėžti
echo: aidas
elif: kitaip jei
else: kitaip
in: viduje
input: įvestis
left: kairė
length: ilgis
or: arba
orange: oranžinė
play: paleisti
pressed: paspaustas
purple: violetinė
quote: "'"
random: atsitiktinis
range: intervalas
red: raudona
remove: pašalinti
repeat: pakartoti
return: grąžinti
sleep: miegoti
step: žingsnis
times: dauginti
to: į
to_list: į sąraša
'true': tiesa
'True': Tiesa
turn: sukti
while: kol
white: balta
d7: '7'
is: yra
green: žalia
black: juodas
blue: mėlynas
gray: pilka
d0: '0'
'false': melas
d5: '5'
d8: '8'
d9: '9'
'False': Melas
not_in: ne viduje
from:
yellow: geltona
for: kartoti
forward: toliau
if: jei
with: su
pink: rožinė
print: spausdinti
right: dešinė
1 change: 1 addition & 0 deletions content/pages/lt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions content/slides/lt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions content/workbooks/lt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
54 changes: 54 additions & 0 deletions grammars/keywords-lt.lark
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
_DEFINE: ("apibrėžti" | "define") _SPACE?
_CALL: ("iškviesti" | "call") _SPACE?
_WITH: ("su" | "with") _SPACE?
_DEF: ("apibrėžti" | "def") _SPACE?
_RETURN: ("grąžinti" | "return") _SPACE?
_PRINT: ("spausdinti" | "print") _SPACE?
_PLAY: ("paleisti" | "play") _SPACE
_ASK: ("paklausti" | "ask")
_ECHO: ("aidas" | "echo") _SPACE?
_FORWARD: ("toliau" | "forward") _SPACE?
_TURN: ("sukti" | "turn") _SPACE?
left: ("kairė" | "left") _SPACE?
right: ("dešinė" | "right") _SPACE?
black: ("juodas" | "black") _SPACE?
blue: ("mėlynas" | "blue") _SPACE?
brown: ("rudas" | "brown") _SPACE?
gray: ("pilka" | "gray") _SPACE?
green: ("žalia" | "green") _SPACE?
orange: ("oranžinė" | "orange") _SPACE?
pink: ("rožinė" | "pink") _SPACE?
purple: ("violetinė" | "purple") _SPACE?
red: ("raudona" | "red") _SPACE?
white: ("balta" | "white") _SPACE?
yellow: ("geltona" | "yellow") _SPACE?
_IS: _SPACE ("yra" | "is") _SPACE
_STANDALONE_IS: ("yra" | "is")
_SLEEP: ("miegoti" | "sleep") _SPACE?
_ADD_LIST: ("pridėti" | "add") _SPACE
_TO_LIST: _SPACE? ("į sąraša" | "to")
_REMOVE: ("pašalinti" | "remove") _SPACE
_FROM: _SPACE? ("" | "from")
_AT: _SPACE ("adresu" | "at") _SPACE
random: ("atsitiktinis" | "random") _SPACE?
_IN: _SPACE ("viduje" | "in") _SPACE
_NOT_IN: _SPACE ("ne viduje" | "not in") _SPACE
_IF: ("jei" | "if") _SPACE
_ELSE: "kitaip" | "else"
_AND: _SPACE? ("ir" | "and") _SPACE
_REPEAT: ("pakartoti" | "repeat") _SPACE
_TIMES: _SPACE ("dauginti" | "times")
_FOR: ("kartoti" | "for") _SPACE
_RANGE: ("intervalas" | "range") _SPACE?
_TO: _SPACE ("į" | "to") _SPACE
_STEP: "žingsnis" | "step"
_ELIF: _SPACE? ("kitaip jei" | "elif") _SPACE
_INPUT: ("įvestis" | "input")
_OR: _SPACE? ("arba" | "or") _SPACE
_WHILE: ("kol" | "while") _SPACE
_LENGTH: "ilgis" | "length"
_COLOR : ("spalva" | "color") _SPACE?
_PRESSED: ("paspaustas" | "pressed") _SPACE?
clear: ("išvalyti" | "clear") _SPACE?
TRUE: ("tiesa" | "Tiesa" | "true" | "True") _SPACE?
FALSE: ("melas" | "Melas" | "false" | "False") _SPACE?
59 changes: 59 additions & 0 deletions highlighting/highlighting-trad.json
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,65 @@
"yellow": "yellow",
"DIGIT": "0123456789"
},
"lt": {
"False": "Melas|False",
"True": "Tiesa|True",
"add": "pridėti|add",
"and": "ir|and",
"ask": "paklausti|ask",
"at": "adresu|at",
"black": "juodas|black",
"blue": "mėlynas|blue",
"brown": "rudas|brown",
"call": "iškviesti|call",
"clear": "išvalyti|clear",
"color": "spalva|color",
"comma": ",",
"def": "apibrėžti|def",
"define": "apibrėžti|define",
"echo": "aidas|echo",
"elif": "kitaip jei|elif",
"else": "kitaip|else",
"false": "melas|false",
"for": "kartoti|for",
"forward": "toliau|forward",
"from": "iš|from",
"gray": "pilka|gray",
"green": "žalia|green",
"if": "jei|if",
"in": "viduje|in",
"input": "įvestis|input",
"is": "yra|is",
"left": "kairė|left",
"length": "ilgis|length",
"not_in": "ne viduje|not in",
"or": "arba|or",
"orange": "oranžinė|orange",
"pink": "rožinė|pink",
"play": "paleisti|play",
"pressed": "paspaustas|pressed",
"print": "spausdinti|print",
"purple": "violetinė|purple",
"random": "atsitiktinis|random",
"range": "intervalas|range",
"red": "raudona|red",
"remove": "pašalinti|remove",
"repeat": "pakartoti|repeat",
"return": "grąžinti|return",
"right": "dešinė|right",
"sleep": "miegoti|sleep",
"step": "žingsnis|step",
"times": "dauginti|times",
"to": "į|to",
"to_list": "į sąraša|to",
"true": "tiesa|true",
"turn": "sukti|turn",
"while": "kol|while",
"white": "balta|white",
"with": "su|with",
"yellow": "geltona|yellow",
"DIGIT": "0123456789"
},
"mi": {
"False": "False",
"True": "True",
Expand Down
Loading

0 comments on commit 18a1235

Please sign in to comment.