Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Felienne/hedy into weblate_5187
Browse files Browse the repository at this point in the history
  • Loading branch information
boryanagoncharenko committed Oct 29, 2024
2 parents e443e9b + a6c2040 commit 6713f88
Show file tree
Hide file tree
Showing 23 changed files with 12,352 additions and 234 deletions.
172 changes: 85 additions & 87 deletions content/adventures/de.yaml

Large diffs are not rendered by default.

5,284 changes: 5,284 additions & 0 deletions content/adventures/kab.yaml

Large diffs are not rendered by default.

207 changes: 207 additions & 0 deletions content/cheatsheets/kab.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
2:
- name: '{is}'
demo_code: "name {is} Hedy\n{print} welcome name"
explanation: Give a word a name to use in the program using `{is}`. You can choose the name yourself.
- name: '{ask}'
demo_code: "color {is} {ask} What is your favorite color?\n{print} color is your favorite!"
explanation: Ask something with `{ask}`. Beware! You need to give the answer a name with `{is}`.
- demo_code: "{print} Let me think for one second...\n{sleep}\n{print} Hmm.. I need 3 more seconds...\n{sleep} 3\n{print} Eureka! Ive got it!"
explanation: With `{sleep}`, you can let Hedy pause for a (couple of) second(s).
name: '{sleep}'
- demo_code: "angle {is} 90\n{turn} angle\n{forward} 100"
explanation: Give a number a name using `{is}`. You can choose the name yourself.
name: '{is} with turtle'
3:
- name: Choose random
explanation: Choose a random word from a group with `{at}` and `{random}`.
demo_code: "animals {is} dog, cat, kangaroo\n{print} animals {at} {random}"
- explanation: '`{add}` an item `{to_list}` a list.'
demo_code: "animals {is} cow, cat\n{add} dog {to_list} animals"
name: '{add}'
- explanation: '`{remove}` an item `{from}` a list.'
demo_code: "animals {is} cat, dog, cow\n{remove} dog {from} animals"
name: '{remove}'
4:
- explanation: Print exactly using quotation marks.
name: '{print}'
demo_code: "{print} 'Hello welcome to Hedy.'"
- demo_code: "name {is} Hedy\n{print} 'my name is ' name"
name: '{is}'
explanation: Give a name to some text and `{print}` without quotation marks.
- name: '{ask}'
explanation: Ask something with `{ask}`.
demo_code: "color {is} {ask} 'What is your favorite color?'\n{print} color ' is your favorite!'"
7:
- explanation: Print exactly using quotation marks.
name: '{print}'
demo_code: "{print} 'Hello welcome to Hedy.'"
- name: '{ask}'
explanation: Ask something with `{ask}`.
demo_code: "color = {ask} 'What is your favorite color?'\n{print} color ' is your favorite!'"
- name: '{if}'
explanation: Make a choice with `{if}`.
demo_code: "color = {ask} 'What is your favorite color?'\n{if} color {is} green {print} 'pretty!' {else} {print} 'meh'"
- demo_code: '{repeat} 3 {times} {forward} 10'
explanation: Repeat a line of code with `{repeat}`.
name: '{repeat} with turtle'
8:
- name: '{print}'
explanation: Print something. Remember to use a quotation mark for literal printing.
demo_code: "{print} '5 times 5 is ' 5 * 5"
- name: '{ask}'
demo_code: "answer = {ask} 'What is 5 plus 5?'\n{if} answer {is} 10\n {print} 'Well done!'\n {print} 'Indeed, the answer was ' answer\n{else}\n {print} 'Oops!'\n {print} 'The answer is 10'"
explanation: Ask for the answer to a sum and check if it is correct. We can now print 2 lines.
- explanation: Repeat multiple lines.
name: '{repeat} with turtle'
demo_code: "{repeat} 4 {times}\n {turn} 90\n {forward} 50"
- name: '{pressed}'
explanation: Check whether a given key on the keyboard is `{pressed}`.
demo_code: "{if} a {is} {pressed}\n {print} 'You pressed A!'\n{else}\n {print} 'You pressed another key!'"
13:
- explanation: Two parts both need to be correct.
demo_code: "answer1 = {ask} 'What is 3+2?'\nanswer2 = {ask} 'What is 2+2?'\n{if} answer1 {is} 5 {and} answer2 {is} 4\n {print} 'Both answers are correct!'\n{else}\n {print} 'At least one answer is wrong!'"
name: '{and}'
- demo_code: "answer1 = {ask} 'What is 3+2?'\nanswer2 = {ask} 'What is 2+2?'\n{if} answer1 {is} 5 {or} answer2 {is} 4\n {print} 'At least one answer is correct!'\n{else}\n {print} 'Both answers are wrong!'"
name: '{or}'
explanation: At least 1 of the two parts need to be correct. If both are correct, it is also fine.
14:
- name: Smaller
explanation: We use the `<` to check if the first number is smaller than the second number.
demo_code: "age = {ask} 'How old are you?'\n{if} age < 13\n {print} 'You are younger than me!'"
- demo_code: "age = {ask} 'How old are you?'\n{if} age > 13\n {print} 'You are older than me!'"
name: Bigger
explanation: We use the `>` to check if the first number is bigger than the second number.
- demo_code: "answer = {ask} 'What is 5 * 5?'\n{if} answer == 25\n {print} 'That is correct!'"
name: Equal
explanation: We use the `==` to check if two things are the same.
- explanation: We use the `!=` to check if two things are not the same.
name: Not equal
demo_code: "answer = {ask} 'What is 5 * 5?'\n{if} answer != 25\n {print} 'That is not correct!'"
- demo_code: "age = {ask} 'How old are you?'\n{if} age <= 12\n {print} 'You are younger than me!'"
name: Smaller or equal
explanation: We use the `<=` to check if the first number is smaller than or equal to the second number.
- demo_code: "age = {ask} 'How old are you?'\n{if} age >= 14\n {print} 'You are older than me!'"
explanation: We use the `>=` to check if the first number is bigger than or equal to the second number.
name: Bigger or equal
16:
- name: square brackets
explanation: Lists with square brackets.
demo_code: "fruit = ['apple', 'banana', 'cherry']\n{print} fruit"
- name: Get an item from a list
explanation: To get an item from a list we use [number] so fruit[1] means, get the first fruit from the list!
demo_code: "fruit = ['banana', 'apple', 'cherry']\nfirstfruit = fruit[1]\n{print} firstfruit"
- name: Get a random item from a list
explanation: To get a random item from a list we use [{random}] so fruit[{random}] means, get a random fruit from the list!
demo_code: "fruit = ['banana', 'apple', 'cherry']\nrandom_fruit = fruit[{random}]\n{print} random_fruit"
17:
- explanation: '`{elif}`'
demo_code: "a = 2\n{if} a == 1:\n {print} 'a is 1'\n{elif} a == 2:\n {print} 'a is 2'\n{else}:\n {print} 'a is not 1 or 2'"
name: '{elif}'
- name: '{print}'
demo_code: "{for} i {in} {range} 1 {to} 12:\n {print} i\n{print} 'Ready or not, here I come!'"
explanation: When we use a `{for}`, we need to put a `:` behind the `{for}` statement!
- name: '{if}'
explanation: We need to do the same with all of our `{if}` statements.
demo_code: "color = {ask} 'What is your favorite color?'\n{if} color == 'green':\n {print} 'Your favorite color is green'\n{else}:\n {print} 'Your favorite color is not green'"
18:
- explanation: After `{print}` you need to use parentheses.
demo_code: "{print}('hi!')"
name: '{print}'
- name: '{range}'
explanation: After `{range}` you need to use parentheses.
demo_code: "{for} i {in} {range} (1,10):\n {print}('Hello, times ', i)"
- demo_code: "name = 'Hedy'\n{print}('my name is ', name)"
explanation: With `{print}` you need to use parentheses and commas if you print more items.
name: '{print} with var'
- name: ask something with {input}
explanation: Use `{input}` instead of `{ask}` to ask something.
demo_code: "name = {input}('What is your name?')\n{print}('So your name is ', name)"
5:
- explanation: Print exactly using quotation marks.
name: '{print}'
demo_code: "{print} 'Hello welcome to Hedy.'"
- name: '{ask}'
demo_code: "color {is} {ask} 'What is your favorite color?'\n{print} color ' is your favorite!'"
explanation: Ask something with `{ask}`.
- demo_code: "color {is} {ask} 'What is your favorite color?'\n{if} color {is} green {print} 'pretty!' {else} {print} 'meh'"
explanation: Make a choice with `{if}`.
name: '{if}'
- name: '{if} with turtle'
explanation: Make a choice with `{if}`.
demo_code: "answer {is} {ask} 'How far should I walk?'\n{if} answer {is} far {forward} 100 {else} {forward} 5"
- demo_code: "pretty_colors {is} green, yellow\ncolor {is} {ask} 'What is your favorite color?'\n{if} color {in} pretty_colors {print} 'pretty!' {else} {print} 'meh'"
explanation: Check elements with `{in}`.
name: '{in}'
- demo_code: "{if} a {is} {pressed} {print} 'You pressed A!' {else} {print} 'You pressed another key!'"
explanation: Check whether a given key on the keyboard is `{pressed}`.
name: '{pressed}'
9:
- name: '{if} with multiple lines'
demo_code: "answer = {ask} 'What is 10 plus 10?'\n{if} answer {is} 20\n {print} 'Well done!!'\n {print} 'The answer is indeed' answer\n{else}\n {print} 'Wrong'\n {print} 'The answer is 20'"
explanation: The answer of a sum of questions with `{ask}` and see if it is correct. Now we print out two lines.
- explanation: Repeat multiple lines.
name: '{repeat} with turtle'
demo_code: "{repeat} 4 {times}\n {turn} 90\n {forward} 50"
12:
- explanation: Decimal numbers.
demo_code: "{print} 'Calculate away!'\n{print} 'Two and a half plus two and a half is...'\n{print} 2.5 + 2.5"
name: float directly
- demo_code: "name = 'Hedy the Robot'\n{print} 'Hello ' name"
explanation: Text with quotation marks after `=`
name: assign text
- explanation: Text with quotation marks after `{if}`.
name: quotes after `{if}` comparison
demo_code: "name = {ask} 'Who are you?'\n{if} name = 'Hedy'\n {print} 'Hi there!'"
- demo_code: "superheroes = 'Iron Man', 'Batman', 'Superman'\n{print} superheroes {at} {random}"
explanation: A list with quotation marks.
name: quotes in list
1:
- demo_code: '{print} Hello welcome to Hedy!'
name: '{print}'
explanation: Print something with `{print}`.
- name: '{ask}'
demo_code: '{ask} What is your favorite color?'
explanation: Ask something with `{ask}`.
- demo_code: "{ask} What is your favorite color?\n{echo} so your favorite color is"
name: '{echo}'
explanation: Repeat something using `{echo}`.
- name: '{print} emojis'
demo_code: '{print} 🙋 🌍 ❗'
explanation: Print an emoji with `{print}`.
- demo_code: '{forward} 100'
explanation: Draw a line with `{forward}`.
name: '{forward}'
- demo_code: "{forward} 25\n{turn} {left}\n{forward} 25\n{turn} {right}"
explanation: Turn the drawing turtle with `{turn}`.
name: '{turn}'
15:
- demo_code: "answer = 0\n{while} answer != 25\n answer = {ask} 'What is 5 times 5?'\n{print} 'A correct answer has been given'"
explanation: We can use the `{while}` loop with not equal.
name: '{while}'
- name: Smaller {while}
demo_code: "count = 1\n{while} count < 3\n {print} 'We do this ' 3 - count ' more times'\n count = count + 1\n{print} 'We are done'"
explanation: We can also use the `{while}` loop with `<` and `>`.
6:
- demo_code: "{print} '5 times 5 is ' 5 * 5"
explanation: Print exactly using quotation marks.
name: '{print}'
- name: '{ask}'
demo_code: "answer = {ask} 'What is 10 plus 10?'\n{if} answer {is} 20 {print} 'Yes!' {else} {print} 'Oops'"
explanation: Ask for a calculation and check whether it is correct.
- name: '`{ask}` and `{if}` with turtle'
explanation: Ask the user how many angles they want.
demo_code: "angles = {ask} 'How many angles?'\nangle = 360 / angles\n{forward} 50"
10:
- name: '{print}'
demo_code: "{print} '5 times 5 is ' 5 * 5"
explanation: Print something. Remember to use a quotation mark for literal printing.
- explanation: Print all things in a list.
name: '{for} with a list'
demo_code: "animals {is} dog, cat, blobfish\n{for} animal {in} animals\n {print} 'I love ' animal"
11:
- demo_code: "{for} counter {in} {range} 1 {to} 5\n {print} counter"
explanation: We can use `{for}` with a `{range}`.
name: '{for} loop'
- name: '{ask}'
demo_code: "answer = {ask} 'What is 5 plus 5?'\n{if} answer {is} 10\n {print} 'Well done!'\n {print} 'Indeed, the answer was ' answer\n{else}\n {print} 'Oops!'\n {print} 'The answer is 10'"
explanation: Ask for the answer to a sum and check if it is correct. We can now print 2 lines.
25 changes: 25 additions & 0 deletions content/client-messages/kab.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
haunted: 🦇, 👻, 🎃
turtle: 🐢
Program_too_long: Ahil-ik yettaṭṭaf aṭas n wakud i wakken ad yekker.
Errors_found: Tgiḍ tuccḍa ! Ur ttagad, nselkem ahil
ServerError: You wrote a program we weren't expecting. If you want to help, send us an email with the level and your program at [email protected]. In the meantime, try something a little different and take another look at the examples. Thanks!
restaurant: 🍣, 🍕, 🍔
Execute_error: Yella wayen ur neddi ara akken ilaq lawan n uselkem n wahil.
CheckInternet: Senqed tuqqna-k ɣer Internet tetteddu akken iwata.
Transpile_success:
- Igerrez!
- Gedha!
- Yelha!
- Izad!
- D amahil izaden!
Program_repair: Yezmer wagi d tangalt tameɣtut, tzemreḍ ad t-tṣeggmeḍ ?
Other_error: Ihuh! Waqil nga tuccḍa tamecṭuḥt.
Connection_error: Ur nessaweḍ ara ɣer uqeddac.
Transpile_warning: Ɣur-k!
Transpile_error: Ur nezmir ara ad nseddu ahil-ik.
songs: 🎵,🎶
Unsaved_Changes: Ahil-a ur yettwasekles ara. Tebɣiḍ ad teffɣeḍ war ma teskelseḍ-t?
rock: ✂️, 📜, 🗻
dice: 🎲
Empty_output: This code works but does not print anything. Add a print command to your code or use the turtle to get output.
fortune: 🔮, ✨
67 changes: 67 additions & 0 deletions content/keywords/kab.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
is: d
in: deg
input: sekcem
'True': 'True'
define: sbadu
turn: zzi
if: ma yella
d2: '2'
brown: aqehwi
from: seg
and: akked
remove: kkes
d7: '7'
'false': 'false'
d5: '5'
for: i
clear: sfeḍ
gray: gray
pink: axuxi
'False': 'False'
ask: ssuter
right: ayeffus
while: imi
white: amellal
or: neɣ
range: range
with: akked
repeat: ales
to: ɣer
'true': 'true'
not_in: mačči deg
d6: '6'
return: uɣal ɣer deffir
quote: "'"
at: ar
times: tikkal
forward: welleh
orange: aččinawi
d4: '4'
green: azegzaw
yellow: awreɣ
left: ayeffus
d1: '1'
elif: neɣ ma yella
red: azeggaɣ
random: random
black: aberkan
print: siggez
call: asiwel
d8: '8'
def: def
d9: '9'
pressed: pressed
play: urar
to_list: ɣer
d3: '3'
comma: ','
add: rnu
echo: yerra-d
length: teɣzi
else: neɣ
d0: '0'
color: ini
purple: purple
blue: amidadi
step: takkayt
sleep: gen
Loading

0 comments on commit 6713f88

Please sign in to comment.