Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is loosely inspired by Keep a Changelog.

### Changed

- **Web 0.14.22, text case names in quotation marks:** in lesson 10 the traffic light structure chart now uses the case names `"rot"`, `"gelb"`, `"grün"` (en `"red"` …, pt `"vermelho"` …) and the calculator solution `"+"`, `"-"`, `"*"`, so it is clear they are texts and the generated Java (`case "rot" ->`) is valid. Lesson text, hint and quiz say so (de/en/pt). The simulation still accepts case names without quotes.
- **Web 0.14.21, array output like in Java:** `System.out.println(zahlen)` now prints a reference such as `[I@1e3779b1` in Simulation and Programmieren, as real Java does (`[D@`, `[Z@`, `[Ljava.lang.String;@`, `[[I@`; the same array keeps its id). `Arrays.toString(…)` and `Arrays.deepToString(…)` show the content; `Arrays` needs `import java.util.Arrays;` like javac, and the Java export adds it. The variable table still shows the content. Lesson 15 „Jetzt in Java“ explains reference and `Arrays.toString` (de/en/pt).
- **Web 0.14.18, upper and lower case, exercises „Warum läuft das nicht?“:** lesson 4 gets the new step „Groß- und Kleinschreibung“ (case-sensitive: `zahl`, `Zahl` and `ZAHL` are three names) with a structure chart exercise (`zahl` and `Zahl` both declared, `ZAHL` used), a Kompetenz item and a quiz question; glossary entry case-sensitive. Lessons 4–17 and 19 each get a Java exercise „Warum läuft das nicht?“: the start code doesn't run (misspelled variable such as `Alter`/`Grenze`/`properson`, variable used before it is created or never created, `system.out`, `.Length`, `charat`), the student reads the error message, fixes it and clicks Check (de/en/pt). The Code area now reports wrong case in Java words (`system.out.println`, `System.Out`, `Println`, `math.sqrt`, `text.Length()`, `name.charat(0)`) with the right spelling, blocks Run like javac and offers the 💡 fix; the simulation says „Unbekannte Variable: Zahl. Java unterscheidet Groß- und Kleinschreibung: Meintest du zahl?“ when the name exists in another case (all 21 languages).
- **Web 0.14.17, hint on a missing line break:** when a Java exercise's output is right except that lines run together (e.g. `System.out.print` twice instead of `println`), the check now says „Fast! Es fehlt nur ein Zeilenumbruch …“ and explains print vs. println, instead of only showing a mismatch. `\n` inside an output now starts a new line, so `System.out.print("…\n")` counts like `println` (de/en/pt; all exercises).
Expand Down
10 changes: 5 additions & 5 deletions web/lessons/de/10-fallauswahl.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ Derselbe Automat als Fallauswahl. Hat wahl den Wert 2, wird nur die Spalte 2 aus

## Fälle mit Texten

Die Fälle müssen keine Zahlen sein. Du kannst auch nach dem Inhalt einer `String`-Variablen auswählen. Als Fallname schreibst du dann den Text, zum Beispiel `rot`.
Die Fälle müssen keine Zahlen sein. Du kannst auch nach dem Inhalt einer `String`-Variablen auswählen. Als Fallname schreibst du dann den Text in Anführungszeichen, zum Beispiel `"rot"`. So erkennt man wie im Code, dass es ein Text ist.

::: diagramm l09-ampel.visustruct
Eine Ampel: Je nach eingegebener Farbe erscheint ein anderer Hinweis. Probiere in der Simulation auch eine Farbe aus, die es nicht gibt.
:::

Groß- und Kleinschreibung zählt: `Rot` passt nicht zum Fall `rot`.
Groß- und Kleinschreibung zählt: `Rot` passt nicht zum Fall `"rot"`.

## Übung: Note in Worten

Expand Down Expand Up @@ -75,7 +75,7 @@ test: 6, *, 7 -> 42
test: 1, x, 2 -> Unbekanntes Rechenzeichen
braucht: fallauswahl
tipp: Lies erst alle drei Werte ein. Danach entscheidet eine Fallauswahl über das Rechenzeichen, was gerechnet wird.
tipp: Lege vor der Fallauswahl `int ergebnis = 0` an. In jedem Fall rechnest du zum Beispiel `ergebnis = a + b` und gibst danach `ergebnis` aus. Die Fallnamen sind einfach `+`, `-` und `*`.
tipp: Lege vor der Fallauswahl `int ergebnis = 0` an. In jedem Fall rechnest du zum Beispiel `ergebnis = a + b` und gibst danach `ergebnis` aus. Die Fallnamen sind `"+"`, `"-"` und `"*"` in Anführungszeichen, weil das Rechenzeichen ein `String` ist.
lösung: l09-rechner-loesung.visustruct
:::

Expand Down Expand Up @@ -307,9 +307,9 @@ Schätze dich bei jedem Punkt ehrlich ein: ☂️ noch nicht, ⛅ teilweise, ☀
- [ ] Eine Farbe wie rot, gelb oder grün auswerten
> „Über 30“ ist ein Bereich. Dafür brauchst du eine Verzweigung mit einem Vergleich.

? Du gibst bei der Ampel `Rot` ein, der Fall heißt `rot`. Was passiert?
? Du gibst bei der Ampel `Rot` ein, der Fall heißt `"rot"`. Was passiert?
→ So ist die Fallauswahl aufgebaut
- [ ] Der Fall rot wird ausgeführt.
- [ ] Der Fall `"rot"` wird ausgeführt.
- [x] Der Fall default wird ausgeführt.
- [ ] Die Simulation meldet einen Fehler.
> Groß- und Kleinschreibung zählt. Rot und rot sind verschiedene Texte.
Expand Down
6 changes: 3 additions & 3 deletions web/lessons/diagramme/en/l09-ampel.visustruct
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
</strelem>
<strelem typ="2" zx="0" zy="0">
<text>99;111;108;111;114;</text>
<fall fallname="114;101;100;">
<fall fallname="34;114;101;100;34;">
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;34;83;116;111;112;34;</text>
</strelem>
</fall>
<fall fallname="121;101;108;108;111;119;">
<fall fallname="34;121;101;108;108;111;119;34;">
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;34;87;97;105;116;34;</text>
</strelem>
</fall>
<fall fallname="103;114;101;101;110;">
<fall fallname="34;103;114;101;101;110;34;">
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;34;87;97;108;107;34;</text>
</strelem>
Expand Down
6 changes: 3 additions & 3 deletions web/lessons/diagramme/en/l09-rechner-loesung.visustruct
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
</strelem>
<strelem typ="2" zx="0" zy="0">
<text>111;112;101;114;97;116;111;114;</text>
<fall fallname="43;">
<fall fallname="34;43;34;">
<strelem typ="0" zx="0" zy="0">
<text>114;101;115;117;108;116;32;61;32;97;32;43;32;98;</text>
</strelem>
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;114;101;115;117;108;116;</text>
</strelem>
</fall>
<fall fallname="45;">
<fall fallname="34;45;34;">
<strelem typ="0" zx="0" zy="0">
<text>114;101;115;117;108;116;32;61;32;97;32;45;32;98;</text>
</strelem>
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;114;101;115;117;108;116;</text>
</strelem>
</fall>
<fall fallname="42;">
<fall fallname="34;42;34;">
<strelem typ="0" zx="0" zy="0">
<text>114;101;115;117;108;116;32;61;32;97;32;42;32;98;</text>
</strelem>
Expand Down
6 changes: 3 additions & 3 deletions web/lessons/diagramme/l09-ampel.visustruct
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
</strelem>
<strelem typ="2" zx="0" zy="0">
<text>102;97;114;98;101;</text>
<fall fallname="114;111;116;">
<fall fallname="34;114;111;116;34;">
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;34;83;116;101;104;101;110;32;98;108;101;105;98;101;110;34;</text>
</strelem>
</fall>
<fall fallname="103;101;108;98;">
<fall fallname="34;103;101;108;98;34;">
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;34;87;97;114;116;101;110;34;</text>
</strelem>
</fall>
<fall fallname="103;114;252;110;">
<fall fallname="34;103;114;252;110;34;">
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;34;71;101;104;101;110;34;</text>
</strelem>
Expand Down
6 changes: 3 additions & 3 deletions web/lessons/diagramme/l09-rechner-loesung.visustruct
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
</strelem>
<strelem typ="2" zx="0" zy="0">
<text>122;101;105;99;104;101;110;</text>
<fall fallname="43;">
<fall fallname="34;43;34;">
<strelem typ="0" zx="0" zy="0">
<text>101;114;103;101;98;110;105;115;32;61;32;97;32;43;32;98;</text>
</strelem>
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;101;114;103;101;98;110;105;115;</text>
</strelem>
</fall>
<fall fallname="45;">
<fall fallname="34;45;34;">
<strelem typ="0" zx="0" zy="0">
<text>101;114;103;101;98;110;105;115;32;61;32;97;32;45;32;98;</text>
</strelem>
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;101;114;103;101;98;110;105;115;</text>
</strelem>
</fall>
<fall fallname="42;">
<fall fallname="34;42;34;">
<strelem typ="0" zx="0" zy="0">
<text>101;114;103;101;98;110;105;115;32;61;32;97;32;42;32;98;</text>
</strelem>
Expand Down
6 changes: 3 additions & 3 deletions web/lessons/diagramme/pt/l09-ampel.visustruct
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
</strelem>
<strelem typ="2" zx="0" zy="0">
<text>99;111;114;</text>
<fall fallname="118;101;114;109;101;108;104;111;">
<fall fallname="34;118;101;114;109;101;108;104;111;34;">
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;34;80;97;114;97;34;</text>
</strelem>
</fall>
<fall fallname="97;109;97;114;101;108;111;">
<fall fallname="34;97;109;97;114;101;108;111;34;">
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;34;69;115;112;101;114;97;34;</text>
</strelem>
</fall>
<fall fallname="118;101;114;100;101;">
<fall fallname="34;118;101;114;100;101;34;">
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;34;65;118;97;110;231;97;34;</text>
</strelem>
Expand Down
6 changes: 3 additions & 3 deletions web/lessons/diagramme/pt/l09-rechner-loesung.visustruct
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
</strelem>
<strelem typ="2" zx="0" zy="0">
<text>111;112;101;114;97;100;111;114;</text>
<fall fallname="43;">
<fall fallname="34;43;34;">
<strelem typ="0" zx="0" zy="0">
<text>114;101;115;117;108;116;97;100;111;32;61;32;97;32;43;32;98;</text>
</strelem>
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;114;101;115;117;108;116;97;100;111;</text>
</strelem>
</fall>
<fall fallname="45;">
<fall fallname="34;45;34;">
<strelem typ="0" zx="0" zy="0">
<text>114;101;115;117;108;116;97;100;111;32;61;32;97;32;45;32;98;</text>
</strelem>
<strelem typ="0" zx="0" zy="0">
<text>111;117;116;112;117;116;58;32;114;101;115;117;108;116;97;100;111;</text>
</strelem>
</fall>
<fall fallname="42;">
<fall fallname="34;42;34;">
<strelem typ="0" zx="0" zy="0">
<text>114;101;115;117;108;116;97;100;111;32;61;32;97;32;42;32;98;</text>
</strelem>
Expand Down
10 changes: 5 additions & 5 deletions web/lessons/en/10-fallauswahl.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ The same machine as a switch. If choice has the value 2, only column 2 runs.

## Cases with text

The cases do not have to be numbers. You can also choose by the content of a `String` variable. Then you write the text as the case name, for example `red`.
The cases do not have to be numbers. You can also choose by the content of a `String` variable. Then you write the text in quotation marks as the case name, for example `"red"`. Just like in code, this shows that it is a text.

::: diagramm l09-ampel.visustruct
A traffic light: depending on the colour typed in, a different message appears. In the simulation, also try a colour that does not exist.
:::

Upper and lower case matter: `Red` does not match the case `red`.
Upper and lower case matter: `Red` does not match the case `"red"`.

## Exercise: Grade in words

Expand Down Expand Up @@ -75,7 +75,7 @@ test: 6, *, 7 -> 42
test: 1, x, 2 -> Unknown operator
braucht: fallauswahl
tipp: First read in all three values. After that, a switch on the operator decides what is calculated.
tipp: Before the switch, create `int result = 0`. In each case you calculate, for example, `result = a + b` and then output `result`. The case names are simply `+`, `-` and `*`.
tipp: Before the switch, create `int result = 0`. In each case you calculate, for example, `result = a + b` and then output `result`. The case names are `"+"`, `"-"` and `"*"` in quotation marks, because the operator is a `String`.
lösung: l09-rechner-loesung.visustruct
:::

Expand Down Expand Up @@ -307,9 +307,9 @@ Rate yourself honestly for each point: ☂️ not yet, ⛅ partly, ☀️ I can
- [ ] Handling a colour such as red, yellow or green
> “Above 30” is a range. For that you need a branch with a comparison.

? At the traffic light you type `Red`, and the case is called `red`. What happens?
? At the traffic light you type `Red`, and the case is called `"red"`. What happens?
→ How a switch is built
- [ ] The case red runs.
- [ ] The case `"red"` runs.
- [x] The case default runs.
- [ ] The simulation reports an error.
> Upper and lower case matter. Red and red are different texts.
Expand Down
10 changes: 5 additions & 5 deletions web/lessons/pt/10-fallauswahl.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ A mesma máquina como seleção. Se escolha tiver o valor 2, só é executada a

## Casos com texto

Os casos não têm de ser números. Também podes escolher pelo conteúdo de uma variável `String`. Então escreves o texto como nome do caso, por exemplo `vermelho`.
Os casos não têm de ser números. Também podes escolher pelo conteúdo de uma variável `String`. Então escreves o texto entre aspas como nome do caso, por exemplo `"vermelho"`. Tal como no código, isto mostra que é um texto.

::: diagramm l09-ampel.visustruct
Um semáforo: consoante a cor introduzida, aparece uma mensagem diferente. Na simulação, experimenta também uma cor que não existe.
:::

Maiúsculas e minúsculas contam: `Vermelho` não corresponde ao caso `vermelho`.
Maiúsculas e minúsculas contam: `Vermelho` não corresponde ao caso `"vermelho"`.

## Exercício: Nota por extenso

Expand Down Expand Up @@ -75,7 +75,7 @@ test: 6, *, 7 -> 42
test: 1, x, 2 -> Operador desconhecido
braucht: fallauswahl
tipp: Primeiro lê os três valores. Depois, uma seleção sobre o operador decide o que é calculado.
tipp: Antes da seleção, cria `int resultado = 0`. Em cada caso calculas, por exemplo, `resultado = a + b` e depois mostras `resultado`. Os nomes dos casos são simplesmente `+`, `-` e `*`.
tipp: Antes da seleção, cria `int resultado = 0`. Em cada caso calculas, por exemplo, `resultado = a + b` e depois mostras `resultado`. Os nomes dos casos são `"+"`, `"-"` e `"*"` entre aspas, porque o operador é uma `String`.
lösung: l09-rechner-loesung.visustruct
:::

Expand Down Expand Up @@ -307,9 +307,9 @@ Avalia-te com honestidade em cada ponto: ☂️ ainda não, ⛅ em parte, ☀️
- [ ] Tratar uma cor como vermelho, amarelo ou verde
> “Acima dos 30” é um intervalo. Para isso precisas de uma decisão com uma comparação.

? No semáforo escreves `Vermelho`, e o caso chama-se `vermelho`. O que acontece?
? No semáforo escreves `Vermelho`, e o caso chama-se `"vermelho"`. O que acontece?
→ Como se constrói uma seleção
- [ ] É executado o caso vermelho.
- [ ] É executado o caso `"vermelho"`.
- [x] É executado o caso default.
- [ ] A simulação indica um erro.
> Maiúsculas e minúsculas contam. Vermelho e vermelho são textos diferentes.
Expand Down
4 changes: 2 additions & 2 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "visustruct-web",
"private": true,
"version": "0.14.21",
"version": "0.14.22",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
Loading
Loading