Skip to content
This repository was archived by the owner on Nov 7, 2026. It is now read-only.
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.25, „Bombe entschärfen“: tap part of a line:** a bomb round can name the wrong part with `stelle:` (e.g. `stelle: i++`). Such rounds show the parts of every line as tappable boxes (the three fields of a `for` header, the condition of `if`/`while`, target and value of an assignment, call and arguments split at `+`); right line but wrong part gives its own hint. Lesson 13 (6 of 8 rounds) and lesson 15 (all 6 rounds) use it (de/en/pt, texts in all 21 languages).
- **Web 0.14.24, animation: while becomes for in lesson 13:** step 2 „Zählen mit festem Plan“ of the for loop lesson shows an animated structure chart: the while loop's start value (`int i = 1`), condition (`i <= 5`) and step (`i++`) light up one after another in their own colour and then move together into the head of the for loop, labelled Start, Bedingung, Schritt (en Init/Condition/Step, pt Início/Condição/Passo). It plays once when it scrolls into view; „Noch einmal abspielen“ replays it. With reduced motion only the end state is shown. New lesson block `::: grafik datei.svg animiert` (own SVG with CSS animation, no library).
- **Web 0.14.23, compact nested branches:** a two-way branch keeps both columns the same width only when neither column contains another branch or switch. Before, each nesting level doubled the width, so the drinks machine in lesson 10 step 2 (three nested branches) was about 3000 px wide and unreadable in the lesson and in the editor; now it is about half as wide, and 20 other lesson diagrams (e.g. VisuBot solutions, L17 ticket) get narrower too. Columns of a branch or switch inside a loop or another branch now always fill the box; before, the header could stay wider than its columns, so the if in lesson 14 step 3 looked like a loop (37 lesson diagrams affected). Wide diagrams in the lesson text no longer shrink below 60 % of their size; they scroll sideways instead.
- **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.
Expand Down
5 changes: 5 additions & 0 deletions web/lessons/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ besser: System.out.println(i);
`fehler:` ist die Nummer der falschen Zeile (ab 1), `besser:` die richtige Zeile. Der Test setzt sie ein und prüft, dass
Java dann keinen Fehler mehr meldet.

Mit `stelle:` (nach `fehler:`) tippt man in dieser Runde nicht ganze Zeilen an, sondern Teile davon: die drei Felder
einer `for`-Schleife, die Bedingung von `if`/`while`, Ziel und Wert einer Zuweisung, Aufruf und Argumente (an `+`
geteilt). `stelle:` ist genau der falsche Teil, z. B. `stelle: i++`. Ist es kein Teil der Zeile, nennt die Fehlermeldung
die möglichen Teile. Fehler wie ein fehlendes `;` bleiben ohne `stelle:`.

Mit `daten: csv` (vor der ersten Runde) ist der Code einer Bombe eine CSV-Datei. Der Test prüft dann, dass jede Zeile mit
`besser:` so viele Felder hat wie die Kopfzeile und die falsche Zeile nicht.

Expand Down
8 changes: 7 additions & 1 deletion web/lessons/de/13-for-schleife.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ lösung: l13-java-laeuft-nicht-loesung.visustruct

::: spiel bombe
titel: Spiel: Bombe entschärfen
intro: In jedem Programm steckt **genau ein Fehler**, und die Bombe tickt. Lies, was das Programm tun soll, und tippe auf die falsche Zeile, bevor die Zeit abläuft. Acht Runden, je 25 Sekunden.
intro: In jedem Programm steckt **genau ein Fehler**, und die Bombe tickt. Lies, was das Programm tun soll, und tippe auf die falsche Zeile, bevor die Zeit abläuft. Sind die Teile einer Zeile umrandet, tippst du genau auf den falschen Teil, zum Beispiel nur auf `i++`. Acht Runden, je 25 Sekunden.
zeit: 25

runde:
Expand All @@ -229,6 +229,7 @@ runde:
}
frage: Soll von 10 bis 1 rückwärts zählen.
fehler: 1
stelle: i++
besser: for (int i = 10; i >= 1; i--) {
> Mit `i++` wird `i` immer größer, die Bedingung `i >= 1` bleibt wahr: eine Endlosschleife. Rückwärts zählst du mit `i--`.
Expand All @@ -240,6 +241,7 @@ runde:
System.out.println(summe);
frage: Soll die Summe 1 + 2 + 3 + 4 = 10 ausgeben.
fehler: 3
stelle: i
besser: summe = summe + i;
> `summe = i` überschreibt die Summe in jedem Durchlauf. Am Ende steht dort nur 4.
Expand All @@ -249,6 +251,7 @@ runde:
}
frage: Soll genau fünfmal Määäh ausgeben.
fehler: 1
stelle: i <= 5
besser: for (int i = 0; i < 5; i++) {
> Von 0 bis einschließlich 5 sind es sechs Durchläufe. Wer bei 0 anfängt, nimmt `<`.
Expand All @@ -258,6 +261,7 @@ runde:
}
frage: Soll 1, 2 und 3 ausgeben.
fehler: 2
stelle: system.out.println
besser: System.out.println(i);
> Java unterscheidet Groß- und Kleinbuchstaben: `System` schreibt man mit großem S.
Expand All @@ -268,6 +272,7 @@ runde:
}
frage: Soll die Siebenerreihe ausgeben: 7 x 1 = 7, 7 x 2 = 14 und so weiter.
fehler: 3
stelle: zahl * zahl
besser: System.out.println(zahl + " x " + i + " = " + zahl * i);
> `zahl * zahl` ist immer 49. Gerechnet werden muss `zahl * i`.
Expand All @@ -277,6 +282,7 @@ runde:
}
frage: Soll die geraden Zahlen 2, 4, 6, 8 und 10 ausgeben.
fehler: 1
stelle: i + 2
besser: for (int i = 2; i <= 10; i = i + 2) {
> `i + 2` rechnet nur, speichert aber nichts. Damit `i` wirklich wächst, braucht es `i = i + 2`.
:::
Expand Down
8 changes: 7 additions & 1 deletion web/lessons/de/15-arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ lösung: l15-java-laeuft-nicht-loesung.visustruct

::: spiel bombe
titel: Spiel: Bombe entschärfen
intro: In jedem Programm steckt **genau ein Fehler** rund um Arrays, und die Bombe tickt. Tippe auf die falsche Zeile, bevor die Zeit abläuft. Sechs Runden, je 30 Sekunden.
intro: In jedem Programm steckt **genau ein Fehler** rund um Arrays, und die Bombe tickt. Tippe auf die falsche Zeile, bevor die Zeit abläuft. Sind die Teile einer Zeile umrandet, tippst du genau auf den falschen Teil. Sechs Runden, je 30 Sekunden.
zeit: 30

runde:
Expand All @@ -241,6 +241,7 @@ runde:
}
frage: Soll alle fünf Werte ausgeben.
fehler: 2
stelle: i <= zahlen.length
besser: for (int i = 0; i < zahlen.length; i++) {
> Mit `<=` läuft i bis 5. Das Fach `zahlen[5]` gibt es nicht.
Expand All @@ -249,6 +250,7 @@ runde:
System.out.println(namen[1]);
frage: Soll den ersten Namen ausgeben, also Ada.
fehler: 2
stelle: namen[1]
besser: System.out.println(namen[0]);
> Gezählt wird ab 0. `namen[1]` ist schon Ben.
Expand All @@ -257,6 +259,7 @@ runde:
System.out.println(zahlen[zahlen.length]);
frage: Soll den letzten Wert ausgeben, also 10.
fehler: 2
stelle: zahlen[zahlen.length]
besser: System.out.println(zahlen[zahlen.length - 1]);
> Der letzte Index ist immer eins weniger als die Länge.
Expand All @@ -269,6 +272,7 @@ runde:
System.out.println(summe);
frage: Soll die Summe 14 ausgeben.
fehler: 4
stelle: punkte[i]
besser: summe = summe + punkte[i];
> So überschreibt jeder Wert den vorigen, am Ende steht nur 2 in summe.
Expand All @@ -283,6 +287,7 @@ runde:
System.out.println(max);
frage: Soll das Maximum -2 ausgeben.
fehler: 2
stelle: 0
besser: int max = punkte[0];
> Keine der Zahlen ist größer als 0, also bliebe max bei 0. Das Maximum beginnt deshalb mit dem ersten Fach.
Expand All @@ -293,6 +298,7 @@ runde:
}
frage: Soll die Werte rückwärts ausgeben, von 10 bis 2.
fehler: 2
stelle: int i = zahlen.length
besser: for (int i = zahlen.length - 1; i >= 0; i--) {
> Rückwärts beginnt man beim letzten Index, und der ist `zahlen.length - 1`.
:::
Expand Down
8 changes: 7 additions & 1 deletion web/lessons/en/13-for-schleife.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ lösung: l13-java-laeuft-nicht-loesung.visustruct

::: spiel bombe
titel: Game: Defuse the bomb
intro: Every program hides **exactly one mistake**, and the bomb is ticking. Read what the program should do and tap the wrong line before time runs out. Eight rounds, 25 seconds each.
intro: Every program hides **exactly one mistake**, and the bomb is ticking. Read what the program should do and tap the wrong line before time runs out. If the parts of a line have a border, tap exactly the wrong part, for example just `i++`. Eight rounds, 25 seconds each.
zeit: 25

runde:
Expand All @@ -229,6 +229,7 @@ runde:
}
frage: Should count backwards from 10 to 1.
fehler: 1
stelle: i++
besser: for (int i = 10; i >= 1; i--) {
> With `i++`, `i` keeps growing and the condition `i >= 1` stays true: an endless loop. To count backwards, use `i--`.
Expand All @@ -240,6 +241,7 @@ runde:
System.out.println(sum);
frage: Should output the sum 1 + 2 + 3 + 4 = 10.
fehler: 3
stelle: i
besser: sum = sum + i;
> `sum = i` overwrites the sum in every pass. In the end it only holds 4.
Expand All @@ -249,6 +251,7 @@ runde:
}
frage: Should output Baaa exactly five times.
fehler: 1
stelle: i <= 5
besser: for (int i = 0; i < 5; i++) {
> From 0 up to and including 5 there are six passes. If you start at 0, use `<`.
Expand All @@ -258,6 +261,7 @@ runde:
}
frage: Should output 1, 2 and 3.
fehler: 2
stelle: system.out.println
besser: System.out.println(i);
> Java tells upper and lower case apart: `System` is written with a capital S.
Expand All @@ -268,6 +272,7 @@ runde:
}
frage: Should output the 7 times table: 7 x 1 = 7, 7 x 2 = 14 and so on.
fehler: 3
stelle: number * number
besser: System.out.println(number + " x " + i + " = " + number * i);
> `number * number` is always 49. It has to be `number * i`.
Expand All @@ -277,6 +282,7 @@ runde:
}
frage: Should output the even numbers 2, 4, 6, 8 and 10.
fehler: 1
stelle: i + 2
besser: for (int i = 2; i <= 10; i = i + 2) {
> `i + 2` only calculates and stores nothing. For `i` to really grow, you need `i = i + 2`.
:::
Expand Down
8 changes: 7 additions & 1 deletion web/lessons/en/15-arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ lösung: l15-java-laeuft-nicht-loesung.visustruct

::: spiel bombe
titel: Game: Defuse the bomb
intro: Every program contains **exactly one mistake** to do with arrays, and the bomb is ticking. Tap the wrong line before time runs out. Six rounds, 30 seconds each.
intro: Every program contains **exactly one mistake** to do with arrays, and the bomb is ticking. Tap the wrong line before time runs out. If the parts of a line have a border, tap exactly the wrong part. Six rounds, 30 seconds each.
zeit: 30

runde:
Expand All @@ -241,6 +241,7 @@ runde:
}
frage: Should output all five values.
fehler: 2
stelle: i <= numbers.length
besser: for (int i = 0; i < numbers.length; i++) {
> With `<=`, i runs up to 5. There is no slot `numbers[5]`.
Expand All @@ -249,6 +250,7 @@ runde:
System.out.println(names[1]);
frage: Should output the first name, Ada.
fehler: 2
stelle: names[1]
besser: System.out.println(names[0]);
> Counting starts at 0. `names[1]` is already Ben.
Expand All @@ -257,6 +259,7 @@ runde:
System.out.println(numbers[numbers.length]);
frage: Should output the last value, 10.
fehler: 2
stelle: numbers[numbers.length]
besser: System.out.println(numbers[numbers.length - 1]);
> The last index is always one less than the length.
Expand All @@ -269,6 +272,7 @@ runde:
System.out.println(sum);
frage: Should output the sum 14.
fehler: 4
stelle: points[i]
besser: sum = sum + points[i];
> Like this every value overwrites the one before, and at the end sum only holds 2.
Expand All @@ -283,6 +287,7 @@ runde:
System.out.println(max);
frage: Should output the maximum -2.
fehler: 2
stelle: 0
besser: int max = points[0];
> None of the numbers is greater than 0, so max would stay 0. That's why the maximum starts with the first slot.
Expand All @@ -293,6 +298,7 @@ runde:
}
frage: Should output the values backwards, from 10 to 2.
fehler: 2
stelle: int i = numbers.length
besser: for (int i = numbers.length - 1; i >= 0; i--) {
> Backwards you start at the last index, and that is `numbers.length - 1`.
:::
Expand Down
8 changes: 7 additions & 1 deletion web/lessons/pt/13-for-schleife.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ lösung: l13-java-laeuft-nicht-loesung.visustruct

::: spiel bombe
titel: Jogo: Desativar a bomba
intro: Cada programa esconde **exatamente um erro**, e a bomba está a fazer tiquetaque. Lê o que o programa deve fazer e toca na linha errada antes de o tempo acabar. Oito rondas, 25 segundos cada.
intro: Cada programa esconde **exatamente um erro**, e a bomba está a fazer tiquetaque. Lê o que o programa deve fazer e toca na linha errada antes de o tempo acabar. Se as partes de uma linha tiverem moldura, toca exatamente na parte errada, por exemplo só em `i++`. Oito rondas, 25 segundos cada.
zeit: 25

runde:
Expand All @@ -229,6 +229,7 @@ runde:
}
frage: Deve contar para trás de 10 até 1.
fehler: 1
stelle: i++
besser: for (int i = 10; i >= 1; i--) {
> Com `i++`, `i` fica sempre maior e a condição `i >= 1` continua verdadeira: um ciclo infinito. Para contar para trás usas `i--`.
Expand All @@ -240,6 +241,7 @@ runde:
System.out.println(soma);
frage: Deve mostrar a soma 1 + 2 + 3 + 4 = 10.
fehler: 3
stelle: i
besser: soma = soma + i;
> `soma = i` substitui a soma em cada iteração. No fim fica lá só 4.
Expand All @@ -249,6 +251,7 @@ runde:
}
frage: Deve mostrar Mééé exatamente cinco vezes.
fehler: 1
stelle: i <= 5
besser: for (int i = 0; i < 5; i++) {
> De 0 até 5, inclusive, são seis iterações. Quem começa em 0 usa `<`.
Expand All @@ -258,6 +261,7 @@ runde:
}
frage: Deve mostrar 1, 2 e 3.
fehler: 2
stelle: system.out.println
besser: System.out.println(i);
> O Java distingue maiúsculas de minúsculas: `System` escreve-se com S maiúsculo.
Expand All @@ -268,6 +272,7 @@ runde:
}
frage: Deve mostrar a tabuada do 7: 7 x 1 = 7, 7 x 2 = 14 e assim por diante.
fehler: 3
stelle: numero * numero
besser: System.out.println(numero + " x " + i + " = " + numero * i);
> `numero * numero` dá sempre 49. Tem de ser `numero * i`.
Expand All @@ -277,6 +282,7 @@ runde:
}
frage: Deve mostrar os números pares 2, 4, 6, 8 e 10.
fehler: 1
stelle: i + 2
besser: for (int i = 2; i <= 10; i = i + 2) {
> `i + 2` só calcula e não guarda nada. Para `i` crescer mesmo, é preciso `i = i + 2`.
:::
Expand Down
8 changes: 7 additions & 1 deletion web/lessons/pt/15-arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ lösung: l15-java-laeuft-nicht-loesung.visustruct

::: spiel bombe
titel: Jogo: Desativar a bomba
intro: Cada programa tem **exatamente um erro** com arrays, e a bomba está a fazer tique-taque. Toca na linha errada antes de o tempo acabar. Seis rondas, 30 segundos cada.
intro: Cada programa tem **exatamente um erro** com arrays, e a bomba está a fazer tique-taque. Toca na linha errada antes de o tempo acabar. Se as partes de uma linha tiverem moldura, toca exatamente na parte errada. Seis rondas, 30 segundos cada.
zeit: 30

runde:
Expand All @@ -241,6 +241,7 @@ runde:
}
frage: Deve mostrar os cinco valores.
fehler: 2
stelle: i <= numeros.length
besser: for (int i = 0; i < numeros.length; i++) {
> Com `<=`, i vai até 5. A posição `numeros[5]` não existe.
Expand All @@ -249,6 +250,7 @@ runde:
System.out.println(nomes[1]);
frage: Deve mostrar o primeiro nome, ou seja, Ada.
fehler: 2
stelle: nomes[1]
besser: System.out.println(nomes[0]);
> Conta-se a partir de 0. `nomes[1]` já é o Ben.
Expand All @@ -257,6 +259,7 @@ runde:
System.out.println(numeros[numeros.length]);
frage: Deve mostrar o último valor, ou seja, 10.
fehler: 2
stelle: numeros[numeros.length]
besser: System.out.println(numeros[numeros.length - 1]);
> O último índice é sempre um a menos do que o comprimento.
Expand All @@ -269,6 +272,7 @@ runde:
System.out.println(soma);
frage: Deve mostrar a soma 14.
fehler: 4
stelle: pontos[i]
besser: soma = soma + pontos[i];
> Assim cada valor apaga o anterior, e no fim soma só tem 2.
Expand All @@ -283,6 +287,7 @@ runde:
System.out.println(max);
frage: Deve mostrar o máximo -2.
fehler: 2
stelle: 0
besser: int max = pontos[0];
> Nenhum dos números é maior do que 0, por isso max ficaria em 0. É por isso que o máximo começa com a primeira posição.
Expand All @@ -293,6 +298,7 @@ runde:
}
frage: Deve mostrar os valores de trás para a frente, de 10 a 2.
fehler: 2
stelle: int i = numeros.length
besser: for (int i = numeros.length - 1; i >= 0; i--) {
> De trás para a frente começa-se no último índice, que é `numeros.length - 1`.
:::
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.24",
"version": "0.14.25",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
3 changes: 3 additions & 0 deletions web/src/i18n/ar.strings
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@
"web_game_defused" = "✂️ تم تعطيلها! وجدت الخطأ.";
"web_game_boom_time" = "💥 بوم! انتهى الوقت.";
"web_game_boom_wrong" = "💥 بوم! كان ذلك السطر الخطأ.";
"web_game_boom_part" = "💥 بوم! السطر صحيح، لكن الخطأ في جزء آخر منه.";
"web_game_boom_wrong_part" = "💥 بوم! الخطأ في سطر آخر.";
"web_game_bomb_parts_hint" = "اضغط على الجزء الخاطئ بالضبط.";
"web_game_fix" = "السطر الصحيح:";
"web_game_order_hint" = "اضغط على الخطوات بالترتيب الصحيح.";
"web_debug_step" = "خطوة";
Expand Down
Loading
Loading