diff --git a/cy-GB/images/changing-operator.gif b/cy-GB/images/changing-operator.gif new file mode 100644 index 0000000..8144cba Binary files /dev/null and b/cy-GB/images/changing-operator.gif differ diff --git a/cy-GB/images/comparison-blocks.png b/cy-GB/images/comparison-blocks.png new file mode 100644 index 0000000..1364508 Binary files /dev/null and b/cy-GB/images/comparison-blocks.png differ diff --git a/cy-GB/images/elseif-blocks.gif b/cy-GB/images/elseif-blocks.gif new file mode 100644 index 0000000..fe69fb2 Binary files /dev/null and b/cy-GB/images/elseif-blocks.gif differ diff --git a/cy-GB/images/if-block-location.png b/cy-GB/images/if-block-location.png new file mode 100644 index 0000000..05a1ba9 Binary files /dev/null and b/cy-GB/images/if-block-location.png differ diff --git a/cy-GB/meta.yml b/cy-GB/meta.yml new file mode 100644 index 0000000..0dbb751 --- /dev/null +++ b/cy-GB/meta.yml @@ -0,0 +1,10 @@ +title: Selection +hero_image: images/banner.png +description: How to use if blocks for selection on the micro:bit +version: 4 +listed: false +copyedit: false +last_tested: "2022-05-19" +steps: + - + title: Using if blocks for selection on the micro:bit diff --git a/cy-GB/microbit-translatable.txt b/cy-GB/microbit-translatable.txt new file mode 100644 index 0000000..74118ab --- /dev/null +++ b/cy-GB/microbit-translatable.txt @@ -0,0 +1,7 @@ +The Logic menu with the `if` block highlighted. + +The Comparison section of the Logic menu, with three blocks showing: 0 = 0, 0 > 0, and a string comparison block. + +A demonstration of using the drop-down menu on a comparison block to change the operator. + +An animation showing the + symbol being used to add three 'else if' sections. Finally, the 'else' is removed from the end by clicking the '-' symbol next to it. \ No newline at end of file diff --git a/cy-GB/step_1.md b/cy-GB/step_1.md new file mode 100644 index 0000000..845612b --- /dev/null +++ b/cy-GB/step_1.md @@ -0,0 +1,77 @@ +There might be times when you want a specific part of your program to run **only** when a certain condition is met. In programming, this is called **selection**. + +In MakeCode, the most important block you will use for selection is the `if`{:class='microbitlogic'} block. + +### Using an if block + +You will find the `if`{:class='microbitlogic'} block in the `Logic`{:class='microbitlogic'} menu. + +The Logic menu with the `if` block highlighted. + +You have to put `if`{:class='microbitlogic'} blocks inside other blocks, like `forever`{:class='microbitbasic'} loops or an `on button pressed`{:class='microbitinput'} block. + +You can place other blocks **inside** an `if`{:class='microbitlogic'} block, and they will only run **if** the condition is `true`. + +### The condition + +An important part of the `if`{:class='microbitlogic'} block is the **condition**. The blocks inside an `if`{:class='microbitlogic'} will only run if a condition is `true`. + +You can find the condition blocks in the `Logic`{:class='microbitlogic'} menu of the Toolbox. + +The Comparison section of the Logic menu, with three blocks showing: 0 = 0, 0 >
+
+A condition has two parts:
+
+1. Data
+2. An operator
+
+**Data**
+
+There has to be data on either side of your condition. This can be a variable, a sensor reading, a `true/false`, or a number.
+
+**Operator**
+
+The operators is **how** you are comparing the two pieces of data.
+
+You can think of the operator like a question you are asking about your two pieces of data.
+
+The operators you can use are:
+
+- `=` — are the two sides **equal**?
+- `≠` — are the two sides **not equal**?
+- `>` — is the first piece of data **greater than** the second?
+- `<` — is the first piece of data **less than** the second?
+- `≥` — is the first piece of data **greater than or equal to** the second?
+- `≤` — is the first piece of data **less than or equal to** the second?
+
+You can choose an operator by dragging a comparison block into your `if`{:class='microbitlogic'} block and clicking on the drop-down menu.
+
+<img src= + +#### else if and else + +You can also add more possible outcomes to your `if`{:class='microbitlogic'} block with `else`{:class='microbitlogic'} and `else if`{:class='microbitlogic'} blocks. + +**else** + +Sometimes you might want some code to run if the condition in your `if`{:class='microbitlogic'} block is `false`. To do this, you can use an `else`{:class='microbitlogic'}. + +The blocks inside the `else`{:class='microbitlogic'} part will run **only** when the condition is `false`. + +To add an `else`{:class='microbitlogic'}, you need to click the `+` symbol at the bottom of your `if`{:class='microbitlogic'} block. + +There is also an `if else`{:class='microbitlogic'} block that you can use if you know you will need to do one thing if a condition is true and another if a condition is false. + +**else if** + +An `else if`{:class='microbitlogic'} block allows you to add another condition to check. + +**It will only check the second condition if the first condition is `false`. If you always want both conditions to be checked, you have to add a second `if`{:class='microbitlogic'} block.** + +To add an `else if`{:class='microbitlogic'} block, you click the `+` symbol at the bottom of the `if`{:class='microbitlogic'} block. + +An animation showing the + symbol being used to add three 'else if' sections. Finally, the 'else' is removed from the end by clicking the '-' symbol next to it. + +If you just want an `else if`{:class='microbitlogic'}, you will have to click the `+` twice and then `-` the `else`{:class='microbitlogic'}. + +You will then have to add another `condition`. diff --git a/el-GR/images/changing-operator.gif b/el-GR/images/changing-operator.gif index 8144cba..5443431 100644 Binary files a/el-GR/images/changing-operator.gif and b/el-GR/images/changing-operator.gif differ diff --git a/el-GR/images/comparison-blocks.png b/el-GR/images/comparison-blocks.png index 1364508..988d692 100644 Binary files a/el-GR/images/comparison-blocks.png and b/el-GR/images/comparison-blocks.png differ diff --git a/el-GR/images/elseif-blocks.gif b/el-GR/images/elseif-blocks.gif index fe69fb2..d545618 100644 Binary files a/el-GR/images/elseif-blocks.gif and b/el-GR/images/elseif-blocks.gif differ diff --git a/el-GR/images/if-block-location.png b/el-GR/images/if-block-location.png index 05a1ba9..895d5ab 100644 Binary files a/el-GR/images/if-block-location.png and b/el-GR/images/if-block-location.png differ diff --git a/el-GR/meta.yml b/el-GR/meta.yml index 967462c..7c51e60 100644 --- a/el-GR/meta.yml +++ b/el-GR/meta.yml @@ -1,9 +1,10 @@ -title: Selection +title: Επιλογή hero_image: images/banner.png -description: How to use if blocks for selection on the micro:bit +description: Πώς να χρησιμοποιήσεις τα μπλοκ εάν για επιλογή στο micro:bit version: 4 listed: false copyedit: false last_tested: "2022-05-19" steps: - - title: Using if blocks for selection on the micro:bit + - + title: Χρήση μπλοκ εάν για επιλογή στο micro:bit diff --git a/el-GR/microbit-translatable.txt b/el-GR/microbit-translatable.txt new file mode 100644 index 0000000..b2c8c51 --- /dev/null +++ b/el-GR/microbit-translatable.txt @@ -0,0 +1,7 @@ +Το μενού Λογική με τονισμένο το μπλοκ `εάν`. + +Η ενότητα Σύγκριση του μενού Λογική, με τρία μπλοκ που εμφανίζουν: 0 = 0, 0 > 0 και ένα μπλοκ σύγκρισης συμβολοσειρών. + +Μια επίδειξη χρήσης του αναπτυσσόμενου μενού σε ένα μπλοκ σύγκρισης για την αλλαγή του τελεστή. + +Μια κινούμενη εικόνα που δείχνει το σύμβολο + που χρησιμοποιείς για να προσθέσεις τρεις ενότητες 'αλλιώς εάν'. Στο τέλος, το 'αλλιώς' αφαιρείται από το τέλος κάνοντας κλικ στο σύμβολο '-' δίπλα του. \ No newline at end of file diff --git a/el-GR/step_1.md b/el-GR/step_1.md index 9947001..00b3793 100644 --- a/el-GR/step_1.md +++ b/el-GR/step_1.md @@ -1,75 +1,77 @@ -There might be times when you want a specific part of your program to run **only** when a certain condition is met. In programming, this is called **selection**. +Μπορεί να υπάρχουν φορές που θέλεις ένα συγκεκριμένο μέρος του προγράμματός σου να εκτελείται **μόνο** όταν εκπληρωθεί μια συγκεκριμένη συνθήκη. Στον προγραμματισμό, αυτό ονομάζεται **επιλογή**. -In MakeCode, the most important block you will use for selection is the `if`{:class='microbitlogic'} block. +Στο MakeCode, το πιο σημαντικό μπλοκ που θα χρησιμοποιήσεις για επιλογή είναι το μπλοκ `εάν`{:class='microbitlogic'}. -### Using an if block +### Χρησιμοποιώντας ένα μπλοκ εάν -You will find the `if`{:class='microbitlogic'} block in the `Logic`{:class='microbitlogic'} menu. +Θα βρεις το μπλοκ `εάν`{:class='microbitlogic'} στο μενού `Λογική`{:class='microbitlogic'}. The Logic menu with the `if` block highlighted. -You have to put `if`{:class='microbitlogic'} blocks inside other blocks, like `forever`{:class='microbitbasic'} loops or an `on button pressed`{:class='microbitinput'} block. +Πρέπει να τοποθετήσεις τα μπλοκ `εάν`{:class='microbitlogic'} μέσα σε άλλα μπλοκ, όπως βρόχους `για πάντα`{:class='microbitbasic'} ή ένα μπλοκ `όταν πιεστεί το πλήκτρο`{:class='microbitinput'}. -You can place other blocks **inside** an `if`{:class='microbitlogic'} block, and they will only run **if** the condition is `true`. +Μπορείτε να τοποθετήσετε άλλα μπλοκ **μέσα** σε ένα μπλοκ `if`{:class='microbitlogic'} και αυτά θα εκτελεστούν μόνο **εάν** η συνθήκη είναι `αληθής`. -### The condition +### Η συνθήκη -An important part of the `if`{:class='microbitlogic'} block is the **condition**. The blocks inside an `if`{:class='microbitlogic'} will only run if a condition is `true`. +Ένα σημαντικό μέρος του μπλοκ `εάν`{:class='microbitlogic'} είναι η **συνθήκη**. Τα μπλοκ μέσα σε ένα `εάν`{:class='microbitlogic'} θα εκτελούνται μόνο εάν μια συνθήκη είναι `αληθής`. -You can find the condition blocks in the `Logic`{:class='microbitlogic'} menu of the Toolbox. +Μπορείς να βρεις τα μπλοκ συνθήκης στο μενού `Λογική`{:class='microbitlogic'} της Εργαλειοθήκης. -The Comparison section of the Logic menu, with three blocks showing: 0 = 0, 0 > 0, and a string comparison block. +The Comparison section of the Logic menu, with three blocks showing: 0 = 0, 0 >
 
-A condition has two parts:
-1. Data
-2. An operator
+Μια συνθήκη έχει δύο μέρη:
 
-**Data**
+1. Δεδομένα
+2. Έναν τελεστή
 
-There has to be data on either side of your condition. This can be a variable, a sensor reading, a `true/false`, or a number.
+**Δεδομένα**
 
-**Operator**
+Πρέπει να υπάρχουν δεδομένα και από τις δύο πλευρές της συνθήκης σου. Αυτό μπορεί να είναι μια μεταβλητή, μια ένδειξη αισθητήρα, ένα `αληθές/ψευδές` ή ένας αριθμός.
 
-The operators is **how** you are comparing the two pieces of data.
+**Τελεστής**
 
-You can think of the operator like a question you are asking about your two pieces of data. 
+Οι τελεστές είναι **πώς** συγκρίνεις τα δύο τμήματα των δεδομένων.
 
-The operators you can use are:
-+ `=` — are the two sides **equal**?
-+ `≠` — are the two sides **not equal**?
-+ `>` — is the first piece of data **greater than** the second?
-+ `<` — is the first piece of data **less than** the second?
-+ `≥` — is the first piece of data **greater than or equal to** the second? 
-+ `≤` — is the first piece of data **less than or equal to** the second?
+Μπορείς να σκεφτείς τον τελεστή σαν μια ερώτηση που ρωτάς για τα δύο τμηματα των δεδομένα σου (τελεστέοι).
 
-You can choose an operator by dragging a comparison block into your `if`{:class='microbitlogic'} block and clicking on the drop-down menu.
+Οι τελεστές που μπορείς να χρησιμοποιήσεις είναι:
+
+- `=` — είναι οι δύο τελεστέοι**ίσοι**;
+- `≠` — οι δύο τελεστέοι **δεν είναι ίσοι**;
+- `>` — είναι το πρώτο τμήμα δεδομένων **μεγαλύτερο από** το δεύτερο;
+- `<` — είναι το πρώτο τμήμα δεδομένων **μικρότερο από** το δεύτερο;
+- `≥` — είναι το πρώτο τμήμα δεδομένων **μεγαλύτερο ή ίσο** με το δεύτερο;
+- `≤` — είναι το πρώτο τμήμα δεδομένων **μικρότερο ή ίσο** με το δεύτερο;
+
+Μπορείς να επιλέξεις έναν τελεστή σύροντας ένα μπλοκ σύγκρισης στο μπλοκ `εάν`{:class='microbitlogic'} και κάνοντας κλικ στο αναπτυσσόμενο μενού.
 
 <img src= -#### else if and else +#### αλλιώς εάν και αλλιώς -You can also add more possible outcomes to your `if`{:class='microbitlogic'} block with `else`{:class='microbitlogic'} and `else if`{:class='microbitlogic'} blocks. +Μπορείς επίσης να προσθέσεις περισσότερα πιθανά αποτελέσματα στο μπλοκ `εάν`{:class='microbitlogic'} με τα μπλοκ `αλλιώς`{:class='microbitlogic'} και `αλλιώς εάν`{:class='microbitlogic'}. -**else** +**αλλιώς** -Sometimes you might want some code to run if the condition in your `if`{:class='microbitlogic'} block is `false`. To do this, you can use an `else`{:class='microbitlogic'}. +Μερικές φορές μπορεί να χρειαστεί να εκτελεστεί κάποιος κώδικας εάν η συνθήκη στο μπλοκ `εάν`{:class='microbitlogic'} είναι `ψευδής`. Για να το κάνεις αυτό, μπορείς να χρησιμοποιήσεις μια συνάρτηση `αλλιώς`{:class='microbitlogic'}. -The blocks inside the `else`{:class='microbitlogic'} part will run **only** when the condition is `false`. +Τα μπλοκ μέσα σε ένα `εάν`{:class='microbitlogic'} θα εκτελούνται μόνο εάν μια συνθήκη είναι `αληθής`. -To add an `else`{:class='microbitlogic'}, you need to click the `+` symbol at the bottom of your `if`{:class='microbitlogic'} block. +Για να προσθέσεις ένα `αλλιώς`{:class='microbitlogic'}, πρέπει να κάνεις κλικ στο σύμβολο `+` στο κάτω μέρος του μπλοκ `εάν`{:class='microbitlogic'}. -There is also an `if else`{:class='microbitlogic'} block that you can use if you know you will need to do one thing if a condition is true and another if a condition is false. +Υπάρχει επίσης ένα μπλοκ `if else`{:class='microbitlogic'} που μπορείς να χρησιμοποιήσεις αν γνωρίζεις ότι θα χρειαστεί να κάνεις ένα πράγμα αν μια συνθήκη είναι αληθής και ένα άλλο αν μια συνθήκη είναι ψευδής. -**else if** +**αλλιώς εάν** -An `else if`{:class='microbitlogic'} block allows you to add another condition to check. +Ένα μπλοκ `αλλιώς εάν`{:class='microbitlogic'} σου επιτρέπει να προσθέσεις μια άλλη συνθήκη για έλεγχο. -**It will only check the second condition if the first condition is `false`. If you always want both conditions to be checked, you have to add a second `if`{:class='microbitlogic'} block.** +Θα ελέγξει τη δεύτερη συνθήκη μόνο εάν η πρώτη συνθήκη είναι `ψευδής`. Αν θέλεις να ελέγχονται πάντα και οι δύο συνθήκες, πρέπει να προσθέσεις ένα δεύτερο μπλοκ `εάν`{:class='microbitlogic'}.\*\* -To add an `else if`{:class='microbitlogic'} block, you click the `+` symbol at the bottom of the `if`{:class='microbitlogic'} block. +Για να προσθέσεις ένα μπλοκ `αλλιώς εάν`{:class='microbitlogic'}, πρέπει να κάνεις κλικ στο σύμβολο `+` στο κάτω μέρος του μπλοκ `εάν`{:class='microbitlogic'}. An animation showing the + symbol being used to add three 'else if' sections. Finally, the 'else' is removed from the end by clicking the '-' symbol next to it. -If you just want an `else if`{:class='microbitlogic'}, you will have to click the `+` twice and then `-` the `else`{:class='microbitlogic'}. +Αν θέλεις απλώς ένα `αλλιώς εάν`{:class='microbitlogic'}, θα πρέπει να κάνεις κλικ στο `+` δύο φορές και στη συνέχεια στο `-` στο `αλλιώς`{:class='microbitlogic'}. -You will then have to add another `condition`. +Στη συνέχεια, θα πρέπει να προσθέσεις μια άλλη `συνθήκη`. diff --git a/fr-FR/meta.yml b/fr-FR/meta.yml index d74860f..8b30609 100644 --- a/fr-FR/meta.yml +++ b/fr-FR/meta.yml @@ -1,4 +1,3 @@ ---- title: Sélection hero_image: images/banner.png description: Comment utiliser les blocs si pour la sélection sur le micro:bit @@ -7,4 +6,5 @@ listed: false copyedit: false last_tested: "2022-05-19" steps: - - title: Utilise des blocs si pour la sélection sur le micro:bit + - + title: Utilise des blocs si pour la sélection sur le micro:bit diff --git a/fr-FR/microbit-translatable.txt b/fr-FR/microbit-translatable.txt new file mode 100644 index 0000000..74118ab --- /dev/null +++ b/fr-FR/microbit-translatable.txt @@ -0,0 +1,7 @@ +The Logic menu with the `if` block highlighted. + +The Comparison section of the Logic menu, with three blocks showing: 0 = 0, 0 > 0, and a string comparison block. + +A demonstration of using the drop-down menu on a comparison block to change the operator. + +An animation showing the + symbol being used to add three 'else if' sections. Finally, the 'else' is removed from the end by clicking the '-' symbol next to it. \ No newline at end of file diff --git a/fr-FR/step_1.md b/fr-FR/step_1.md index 8dbbdab..983d96c 100644 --- a/fr-FR/step_1.md +++ b/fr-FR/step_1.md @@ -18,7 +18,7 @@ Une partie importante du bloc `si`{:class='microbitlogic'} est la **condition**. Tu peux trouver les blocs de conditions dans le menu `Logique`{:class='microbitlogic'} de la boîte à outils. -The Comparison section of the Logic menu, with three blocks showing: 0 = 0, 0 > 0, and a string comparison block. +The Comparison section of the Logic menu, with three blocks showing: 0 = 0, 0 >
 
 Une condition comporte deux parties :
 
@@ -27,7 +27,7 @@ Une condition comporte deux parties :
 
 **Données**
 
-Il doit y avoir des données de chaque côté de ta condition. Cela peut être une variable, une lecture de capteur, un `vrai/faux` ou un nombre.
+Il doit y avoir des données de chaque côté de ta condition. Cela peut être une variable, une lecture de capteur, un ` vrai/faux` ou un nombre.
 
 **Opérateur**
 
@@ -42,7 +42,7 @@ Les opérateurs que tu peux utiliser sont :
 - `>` — la première donnée est-elle **supérieure** à la deuxième ?
 - `<` — la première donnée est-elle **inférieure** à la deuxième ?
 - `≥` — la première donnée est-elle **supérieure ou égale** à la deuxième ?
-- `≤` — la première donnée est-elle **inférieure ou égale** à la deuxième ?
+- « ≤ » — la première donnée est-elle **inférieure ou égale** à la deuxième ?
 
 Tu peux choisir un opérateur en faisant glisser un bloc de comparaison dans ton bloc `si`{:class='microbitlogic'} et en cliquant sur le menu déroulant.
 
@@ -56,7 +56,7 @@ Tu peux également ajouter plus de résultats possibles à ton bloc `si`{:class=
 
 Parfois, tu souhaites peut-être que du code s'exécute si la condition dans ton bloc `si`{:class='microbitlogic'} est `faux`. Pour cela, tu peux utiliser un `sinon`{:class='microbitlogic'}.
 
-Les blocs à l'intérieur de la partie `sinon`{:class='microbitlogic'} s'exécuteront **seulement** lorsque la condition est `fausse`.
+Les blocs à l'intérieur de la partie sinon`{:class='microbitlogic'} s'exécuteront **seulement** lorsque la condition est `fausse\`.
 
 Pour ajouter un `sinon`{:class='microbitlogic'}, tu dois cliquer sur le symbole `+` en bas de ton bloc `si`{:class='microbitlogic'}.
 
diff --git a/nl-NL/meta.yml b/nl-NL/meta.yml
index c22ef9b..20109c6 100644
--- a/nl-NL/meta.yml
+++ b/nl-NL/meta.yml
@@ -1,4 +1,3 @@
----
 title: Selectie
 hero_image: images/banner.png
 description: Hoe gebruik je als blokken voor selectie op de micro:bit
@@ -7,4 +6,5 @@ listed: false
 copyedit: false
 last_tested: 0, and a string comparison block. + +A demonstration of using the drop-down menu on a comparison block to change the operator. + +An animation showing the + symbol being used to add three 'else if' sections. Finally, the 'else' is removed from the end by clicking the '-' symbol next to it. \ No newline at end of file diff --git a/nl-NL/step_1.md b/nl-NL/step_1.md index b5c1ce9..d324e4a 100644 --- a/nl-NL/step_1.md +++ b/nl-NL/step_1.md @@ -18,7 +18,7 @@ Een belangrijk deel van het `als`{:class='microbitlogic'} blok is de **voorwaard Je kunt de voorwaarden blokken vinden in het menu `Logisch`{:class='microbitlogic'} van de Toolbox. -The Comparison section of the Logic menu, with three blocks showing: 0 = 0, 0 > 0, and a string comparison block. +The Comparison section of the Logic menu, with three blocks showing: 0 = 0, 0 >
 
 Een voorwaarde bestaat uit twee delen:
 
@@ -44,7 +44,7 @@ De operators die je kan gebruiken zijn:
 - `≥` — is het eerste stukje gegevens **groter dan of gelijk aan** het tweede?
 - `≤` — is het eerste stukje gegevens **kleiner dan of gelijk aan** het tweede?
 
-Je kunt een operator kiezen door een vergelijkingsblok in je 'als' {:class='microbitlogic'} blok te slepen en op het vervolgkeuzemenu te klikken.
+Je kunt een operator kiezen door een vergelijkingsblok in je `als`{:class='microbitlogic'} blok te slepen en op het vervolgkeuzemenu te klikken.
 
 <img src=