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 @@ -15,6 +15,7 @@ The format is loosely inspired by Keep a Changelog.

### Added

- **Web 0.14.11, one Angeberwissen per step in lesson 8:** the „goto fail“ box moves from step „Jetzt in Java“ (which keeps Duke) to step „Lückentext: Gerade oder ungerade“, right after its explanation about curly brackets (de/en/pt).
- **Web 0.14.10, Struktogramm area in green:** the colour of the Struktogramm area (top edge, slim strip, name on the exercise card) is now green #2b8a3e instead of blue, so it stands apart from the blue buttons and links; Code stays violet. The Struktogramm area now has a heading „Struktogramm“ in green above its tools, like „Code“ in violet.
- **Web 0.14.9, Margaret Hamilton and Hedy Lamarr with photo:** lesson 22 (try and catch) gets an Angeberwissen box on Margaret Hamilton: during the Apollo 11 landing in 1969 the onboard computer raised the alarms 1202 and 1201 but did not crash, because her team's software recognised the overload and kept only the most important jobs running; she called her work „software engineering“. Photo 1969 next to the printed Apollo programs (Draper Laboratory, Commons „Margaret Hamilton - restoration.jpg“, PD-US-no notice, 300×400). Lesson 15 (arrays) gets an Angeberwissen box on Hedy Lamarr: 1942 patent with George Antheil, sender and receiver hop through the same list of 88 frequencies in the same order (like a loop through an array), today's frequency hopping e.g. in Bluetooth; worded as an important forerunner, not the sole inventor. Publicity photo 1944 (Commons „Hedy Lamarr Publicity Photo for The Heavenly Body 1944.jpg“, PD-US-no notice, 300×400). de/en/pt.
- **Web 0.14.8, Katherine Johnson with photo:** lesson 7 step „Der Schreibtischtest“ gets an Angeberwissen box: „Computer“ used to be a job; in 1962 John Glenn asked Katherine Johnson to check the IBM computer's orbit calculation by hand before he flew (a real desk check); the toilet scene from „Hidden Figures“ is marked as exaggerated by the film; her colleague Dorothy Vaughan taught herself and her team FORTRAN. Followed by her portrait (NASA 1983, public domain, Commons „Katherine_Johnson_1983.jpg“, 300×400) (de/en/pt).
Expand Down
28 changes: 14 additions & 14 deletions web/lessons/de/08-verzweigung.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,6 @@ tipp: Die Bedingung lautet `punkte >= 50`. In den Zweigen steht `System.out.prin
lösung: l08-java-bestanden-loesung.visustruct
:::

::: angeberwissen
Steht im Zweig nur eine einzige Anweisung, darf man in Java die geschweiften Klammern sogar weglassen. Wir machen das trotzdem nie, und zwar aus diesem Grund:

```java
if (alter >= 18)
System.out.println("Du bist volljährig.");
System.out.println("Du darfst den Film sehen.");
```

Ohne Klammern gehört nur die erste Zeile zum if. Die zweite läuft immer, auch für Zwölfjährige. Die Einrückung täuscht, denn Java achtet nicht auf Leerzeichen.

Genau so ein Fehler steckte 2014 in iPhones und Macs, bekannt als **„goto fail“**. In der Sprache C stand unter einem if ohne Klammern die Zeile `goto fail;` aus Versehen zweimal. Die zweite lief immer und übersprang die Prüfung der Sicherheitszertifikate. In einem offenen WLAN hätte sich ein Angreifer so zum Beispiel als deine Bank ausgeben können. Mäh, Klammern kosten zwei Zeichen, eine Sicherheitslücke kostet viel mehr.
:::

## Lückentext: Gerade oder ungerade

::: lückentext
Expand All @@ -179,6 +165,20 @@ int zahl = scanner.nextInt();
erklärung: `zahl % 2` ist der Rest beim Teilen durch 2. Ist er 0, ist die Zahl gerade. Zum Vergleichen brauchst du `==`, ein einzelnes `=` ist eine Zuweisung. Beide Zweige stehen in geschweiften Klammern.
:::

::: angeberwissen
Steht im Zweig nur eine einzige Anweisung, darf man in Java die geschweiften Klammern sogar weglassen. Wir machen das trotzdem nie, und zwar aus diesem Grund:

```java
if (alter >= 18)
System.out.println("Du bist volljährig.");
System.out.println("Du darfst den Film sehen.");
```

Ohne Klammern gehört nur die erste Zeile zum if. Die zweite läuft immer, auch für Zwölfjährige. Die Einrückung täuscht, denn Java achtet nicht auf Leerzeichen.

Genau so ein Fehler steckte 2014 in iPhones und Macs, bekannt als **„goto fail“**. In der Sprache C stand unter einem if ohne Klammern die Zeile `goto fail;` aus Versehen zweimal. Die zweite lief immer und übersprang die Prüfung der Sicherheitszertifikate. In einem offenen WLAN hätte sich ein Angreifer so zum Beispiel als deine Bank ausgeben können. Mäh, Klammern kosten zwei Zeichen, eine Sicherheitslücke kostet viel mehr.
:::

## Fehler finden: Eintritt

::: übung l08-java-fehler
Expand Down
28 changes: 14 additions & 14 deletions web/lessons/en/08-verzweigung.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,6 @@ tipp: The condition is `points >= 50`. One branch has `System.out.println("passe
lösung: l08-java-bestanden-loesung.visustruct
:::

::: angeberwissen
If a branch holds only a single statement, Java even lets you leave out the curly brackets. We never do that, and here is why:

```java
if (age >= 18)
System.out.println("You are an adult.");
System.out.println("You may watch the film.");
```

Without brackets only the first line belongs to the if. The second one always runs, even for twelve-year-olds. The indentation is misleading, because Java ignores spaces.

Exactly this kind of mistake was hidden in iPhones and Macs in 2014, known as **“goto fail”**. In the language C, the line `goto fail;` accidentally appeared twice under an if without brackets. The second one always ran and skipped the check of the security certificates. On an open Wi-Fi network, an attacker could have pretended to be your bank, for example. Baah, brackets cost two characters, a security hole costs much more.
:::

## Fill in the gaps: even or odd

::: lückentext
Expand All @@ -179,6 +165,20 @@ int number = scanner.nextInt();
erklärung: `number % 2` is the remainder when dividing by 2. If it is 0, the number is even. To compare you need `==`, a single `=` is an assignment. Both branches are in curly brackets.
:::

::: angeberwissen
If a branch holds only a single statement, Java even lets you leave out the curly brackets. We never do that, and here is why:

```java
if (age >= 18)
System.out.println("You are an adult.");
System.out.println("You may watch the film.");
```

Without brackets only the first line belongs to the if. The second one always runs, even for twelve-year-olds. The indentation is misleading, because Java ignores spaces.

Exactly this kind of mistake was hidden in iPhones and Macs in 2014, known as **“goto fail”**. In the language C, the line `goto fail;` accidentally appeared twice under an if without brackets. The second one always ran and skipped the check of the security certificates. On an open Wi-Fi network, an attacker could have pretended to be your bank, for example. Baah, brackets cost two characters, a security hole costs much more.
:::

## Find the bug: admission

::: übung l08-java-fehler
Expand Down
28 changes: 14 additions & 14 deletions web/lessons/pt/08-verzweigung.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,6 @@ tipp: A condição é `pontos >= 50`. Num ramo fica `System.out.println("aprovad
lösung: l08-java-bestanden-loesung.visustruct
:::

::: angeberwissen
Se um ramo tiver só uma instrução, o Java até deixa tirar as chavetas. Nós nunca fazemos isso, e é por esta razão:

```java
if (idade >= 18)
System.out.println("És maior de idade.");
System.out.println("Podes ver o filme.");
```

Sem chavetas, só a primeira linha pertence ao if. A segunda é sempre executada, até para quem tem doze anos. A indentação engana, porque o Java não liga aos espaços.

Foi exatamente um erro destes que estava escondido em iPhones e Macs em 2014, conhecido como **“goto fail”**. Na linguagem C, a linha `goto fail;` aparecia por engano duas vezes debaixo de um if sem chavetas. A segunda era sempre executada e saltava a verificação dos certificados de segurança. Numa rede Wi-Fi aberta, um atacante podia, por exemplo, fazer-se passar pelo teu banco. Mééé, as chavetas custam dois caracteres, uma falha de segurança custa muito mais.
:::

## Preenche os espaços: par ou ímpar

::: lückentext
Expand All @@ -179,6 +165,20 @@ int numero = scanner.nextInt();
erklärung: `numero % 2` é o resto da divisão por 2. Se for 0, o número é par. Para comparar precisas de `==`, um `=` sozinho é uma atribuição. Os dois ramos ficam entre chavetas.
:::

::: angeberwissen
Se um ramo tiver só uma instrução, o Java até deixa tirar as chavetas. Nós nunca fazemos isso, e é por esta razão:

```java
if (idade >= 18)
System.out.println("És maior de idade.");
System.out.println("Podes ver o filme.");
```

Sem chavetas, só a primeira linha pertence ao if. A segunda é sempre executada, até para quem tem doze anos. A indentação engana, porque o Java não liga aos espaços.

Foi exatamente um erro destes que estava escondido em iPhones e Macs em 2014, conhecido como **“goto fail”**. Na linguagem C, a linha `goto fail;` aparecia por engano duas vezes debaixo de um if sem chavetas. A segunda era sempre executada e saltava a verificação dos certificados de segurança. Numa rede Wi-Fi aberta, um atacante podia, por exemplo, fazer-se passar pelo teu banco. Mééé, as chavetas custam dois caracteres, uma falha de segurança custa muito mais.
:::

## Encontra o erro: entrada

::: übung l08-java-fehler
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.10",
"version": "0.14.11",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down

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

Loading
Loading