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.15.5, small lesson fixes from the second review:** the free tasks „Einheitenrechner“ (after L36) and „Würfeln mit MVC“ (after L41) get a list „Du bist fertig, wenn …“ with things you can see in the window and console. L38 „Viele Knöpfe, ein Zuhörer“: Ludwig's tip in the task „Zahlenschloss“ talked about the calculator; it now helps with the task (count wrong attempts, `setEnabled(false)`, stars with a separate `eingabe`). Steps „Profiwissen: …“ in L23, L29, L31, L36 and L37 lose the prefix (Holger: no separate Profiwissen), L39 refers to the step by name. L5 Angeberwissen no longer mentions the coffee-cup logo. de/en/pt. New test: no step title starts with „Profiwissen“.
- **Web 0.15.4, lesson 1 split in two:** VisuStruct lesson 1 „Was ist ein Struktogramm?“ was very long (15 steps). It now covers algorithm, reading a structure chart, the three building blocks, „Erst die Struktur, dann der Code“, the game „Welcher Baustein?“, checklist and quiz. The new lesson 2 „PAP und Pseudocode“ (`01-weitere-darstellungen.md`) takes the flowchart part (PAP elements, exercise „Kuchen backen als PAP“, jumps/GOTO/spaghetti code, pseudocode and comparison) with its own Kompetenzen, a new game „Welche Darstellung?“ (structure chart, flowchart or pseudocode, eight rounds), checklist and quiz (de/en/pt). VisuStruct now numbers lessons like VisuBot: in file order, so the new lesson keeps file number 01 and no file is renamed (progress stays). All later lessons move up by one; „Lektion N“ in texts and `nach:` in tasks are renumbered automatically. Saved step positions in lesson 1 may point to a later step than before. New test checks the split and the renumbered references.
- **Web 0.15.3, VisuBot orange like visucode.de:** the VisuBot theme in the app used #e07000 (buttons, selection, focus) and #f08a00 („Bot“ in the title bar), the visucode.de start page uses #c2410c with the gradient #ea580c → #c2410c (css/visucode.css, MARKE.md). The app now uses the same values; white text on the accent goes from 3.2 : 1 to 5.2 : 1. The command group „Fahren“ (stripe and dot) moves from the old VisuBot orange #d96a00 to #c2410c as well.
- **Web 0.15.2, checklist and quiz always in their own steps:** every lesson in both worlds now ends with its own „Checkliste“ step followed by its own „Wissenstest“ step, after at least one game (Holger: VisuBot lesson 1 step 5 had both in one step before 0.14.33). Three robot lessons still lacked a final quiz step: L2 „Der mBot2“ (game „Sensor oder Aktor?“ moves into its own step before the checklist, the quiz from „Sensoren und Aktoren“ moves to the new „Wissenstest“ and gets six more questions, one per checklist item), L3 „Das Quadrat“ and L27 „Eigene Methoden“ (new „Wissenstest“ with five questions each; the small quizzes inside the steps stay). de/en. A new test (`web/test/lessonEnd.ts`, used by lessons.test.ts and visubotLessons.test.ts) fails if the checklist shares a step with anything else, if the quiz is not alone in the last step, or if no game comes before the checklist. Saved self-assessments in L2 start fresh because steps moved.
Expand Down
2 changes: 1 addition & 1 deletion web/lessons/de/04-variablen-und-datentypen.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ System.out.println("Gesamt: " + gesamtPreis + " Euro");
Wie der Computer deinen Java-Code versteht und warum er auf Windows, macOS und Linux gleich läuft, erfährst du in der Lektion „Struktogramm und Code“.

::: angeberwissen
Java hieß zuerst **Oak** (Eiche), nach dem Baum vor dem Bürofenster von James Gosling. Sein Team bei Sun Microsystems wollte ab 1991 kleine Geräte wie Fernseh-Boxen programmieren. Den Namen Oak hatte aber schon eine andere Firma. Also wurde es 1995 **Java**, wie der Kaffee von der Insel Java. Deshalb ist das Logo eine dampfende Tasse.
Java hieß zuerst **Oak** (Eiche), nach dem Baum vor dem Bürofenster von James Gosling. Sein Team bei Sun Microsystems wollte ab 1991 kleine Geräte wie Fernseh-Boxen programmieren. Den Namen Oak hatte aber schon eine andere Firma. Also wurde es 1995 **Java**, wie der Kaffee von der Insel Java.
:::

## Text in Java
Expand Down
2 changes: 1 addition & 1 deletion web/lessons/de/22-try-und-catch.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ try {

„zwölf“ kann Java nicht umwandeln und wirft eine `NumberFormatException`. Das Programm gibt „Das ist keine Zahl: zwölf“ aus. Ändere die erste Zeile in `String eingabe = "12";` und führe es noch einmal aus: Jetzt erscheint „Doppelt: 24“.

## Profiwissen: Exceptions sind Objekte
## Exceptions sind Objekte

Das steht nicht im Lehrplan, ist aber praktisch zu wissen.

Expand Down
2 changes: 1 addition & 1 deletion web/lessons/de/28-erstes-fenster.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Erst einrichten, dann zeigen. Wie im Theater: Der Vorhang geht erst auf, wenn di

Probier es aus: Lösche die Zeile mit `setVisible(true)` und führe das Programm noch einmal aus. Das Programm läuft, aber du siehst kein Fenster.

## Profiwissen: Klassen und Objekte
## Klassen und Objekte

Das steht nicht im Lehrplan, hilft dir aber, Swing zu verstehen.

Expand Down
2 changes: 1 addition & 1 deletion web/lessons/de/30-der-knopf-reagiert.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ frage: Wie viele Zeilen „Klick!“ stehen danach in der Konsole?
> Der Zuhörer läuft bei **jedem** Klick, nicht nur beim ersten. Drei Klicks, drei Zeilen.
:::

## Profiwissen: ActionListener ist ein Interface
## ActionListener ist ein Interface

Das steht nicht im Lehrplan. Wenn du wissen willst, was hinter dem Pfeil steckt, lies weiter.

Expand Down
2 changes: 1 addition & 1 deletion web/lessons/de/35-taschenrechner.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ geteilt.addActionListener(e -> {
Mit `double` und `Double.parseDouble(…)` gibt es Nachkommastellen: 7 / 2 ergibt 3.5. Dafür wirft Java bei Kommazahlen keine Exception beim Teilen durch 0. Das Ergebnis heißt dann `Infinity`, also „unendlich“.
:::

## Profiwissen: eine eigene Methode
## Eine eigene Methode

Das steht nicht im Lehrplan, macht den Code aber kürzer.

Expand Down
2 changes: 1 addition & 1 deletion web/lessons/de/36-zahlenraten.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class Zahlenraten {
Mit `setEnabled(true)` schaltest du einen Knopf wieder ein. So kannst du zum Beispiel einen Knopf erst freigeben, wenn etwas eingegeben wurde.
:::

## Profiwissen: mit 7 Versuchen gewinnen
## Mit 7 Versuchen gewinnen

::: angeberwissen
Wer geschickt rät, braucht nie mehr als 7 Versuche. Rate immer die Mitte des Bereichs, der noch übrig ist: erst 50, dann 25 oder 75 und so weiter. Jeder Tipp halbiert den Bereich: 100, 50, 25, 13, 7, 4, 2, 1. Das ist die **binäre Suche** aus Lektion 19. Weil 2 hoch 7 = 128 größer als 100 ist, reichen 7 Tipps.
Expand Down
2 changes: 1 addition & 1 deletion web/lessons/de/37-viele-knoepfe-ein-zuhoerer.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ Dann mach es besser:
- im Zusatz die Anzeige nur Sterne zeigt, der Code aber trotzdem geprüft wird.

::: ludwig
Auch beim Taschenrechner aus Lektion 35 reicht ein Zuhörer für +, -, \* und /. Prüfe darin mit `e.getActionCommand().equals("+")`, welches Rechenzeichen geklickt wurde.
Zähle im Zweig für **OK** bei jedem falschen Code `versuche++` und prüfe danach `if (versuche >= 3)`. Dann schaltet `ok.setEnabled(false)` den Knopf ab, wie beim Zahlenraten. Für die Sterne: `eingabe = eingabe + e.getActionCommand();` und `anzeige.setText(anzeige.getText() + "*");`. Verglichen wird dann `eingabe`, nicht der Text der Anzeige.
:::

## Checkliste
Expand Down
2 changes: 1 addition & 1 deletion web/lessons/de/38-innere-klassen.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kurz: Einen Zuhörer als benannte innere Klasse, als anonyme Klasse und als Lamb
Den Klickzähler aus Lektion 32 kennst du schon. Heute schreibst du seinen Zuhörer auf **drei Arten**, die alle genau dasselbe tun:

1. als **benannte innere Klasse**, wie man es vor Java 8 meistens gemacht hat,
2. als **anonyme Klasse**, die du aus dem Profiwissen in Lektion 30 kennst,
2. als **anonyme Klasse**, die du aus Lektion 30 („ActionListener ist ein Interface“) kennst,
3. als **Lambda** mit dem Pfeil, so wie bisher.

In fremdem Code, in Büchern und im Internet triffst du alle drei Schreibweisen. Nach dieser Lektion erkennst du sie.
Expand Down
6 changes: 6 additions & 0 deletions web/lessons/de/aufgaben/einheitenrechner.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ public class Einheiten {
}
```

**Du bist fertig, wenn …**

- 1.5 nach **in cm** „150.0 cm“ zeigt, nach **in mm** „1500.0 mm“,
- 1500 nach **in km** „1.5 km“ zeigt,
- „abc“ im Feld „Bitte eine Zahl eingeben“ zeigt und das Fenster offen bleibt.

Zusatz: Ein vierter Knopf **in Fuß** rechnet in die englische Einheit um. Ein Fuß sind 0.3048 m.

::: ludwig
Expand Down
7 changes: 7 additions & 0 deletions web/lessons/de/aufgaben/wuerfel-mvc.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ Deine Aufgabe:
3. Schreibe die View `StatistikAnzeige`. Sie zeigt zum Beispiel „Sechsen: 2 von 10 Würfen“.
4. Der Controller ist der Zuhörer am Knopf: Er lässt das Model würfeln und gibt beiden Views die neuen Werte.

**Du bist fertig, wenn …**

- in der Konsole nach zehn Würfen `wuerfe` gleich 10 ist und `sechsen` zwischen 0 und 10 liegt,
- jeder Klick auf **Würfeln** eine neue Zahl von 1 bis 6 in der `AugenAnzeige` zeigt,
- die `StatistikAnzeige` nach jedem Klick einen Wurf mehr zählt und Sechsen richtig mitzählt,
- im Model kein `JLabel` und in den Views kein `Math.random` steht.

Zusatz: Ein Knopf **Neues Spiel** setzt alles auf Anfang. Die Methode dafür gehört ins Model.

::: ludwig
Expand Down
2 changes: 1 addition & 1 deletion web/lessons/en/04-variablen-und-datentypen.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ System.out.println("Total: " + totalPrice + " euros");
How the computer understands your Java code and why it runs the same on Windows, macOS and Linux is explained in the lesson “Structure chart and code”.

::: angeberwissen
Java was first called **Oak**, after the tree outside James Gosling’s office window. From 1991 his team at Sun Microsystems wanted to program small devices such as TV set-top boxes. But another company already had the name Oak. So in 1995 it became **Java**, like the coffee from the island of Java. That is why the logo is a steaming cup.
Java was first called **Oak**, after the tree outside James Gosling’s office window. From 1991 his team at Sun Microsystems wanted to program small devices such as TV set-top boxes. But another company already had the name Oak. So in 1995 it became **Java**, like the coffee from the island of Java.
:::

## Text in Java
Expand Down
2 changes: 1 addition & 1 deletion web/lessons/en/22-try-und-catch.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ try {

Java cannot convert “twelve” and throws a `NumberFormatException`. The program prints “That is not a number: twelve”. Change the first line to `String input = "12";` and run it again: now “Double: 24” appears.

## Expert knowledge: exceptions are objects
## Exceptions are objects

This is not in the curriculum, but it is useful to know.

Expand Down
2 changes: 1 addition & 1 deletion web/lessons/en/28-erstes-fenster.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Set up first, then show. Like in the theatre: the curtain only goes up once the

Try it: delete the line with `setVisible(true)` and run the program again. The program runs, but you do not see a window.

## Expert knowledge: classes and objects
## Classes and objects

This is not in the curriculum, but it helps you understand Swing.

Expand Down
2 changes: 1 addition & 1 deletion web/lessons/en/30-der-knopf-reagiert.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ frage: How many lines “Click!” are in the console afterwards?
> The listener runs on **every** click, not only on the first one. Three clicks, three lines.
:::

## Expert knowledge: ActionListener is an interface
## ActionListener is an interface

This is not in the curriculum. If you want to know what is behind the arrow, read on.

Expand Down
2 changes: 1 addition & 1 deletion web/lessons/en/35-taschenrechner.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ divide.addActionListener(e -> {
With `double` and `Double.parseDouble(…)` you get decimal places: 7 / 2 gives 3.5. In return, Java throws no exception when dividing decimal numbers by 0. The result is then `Infinity`.
:::

## Expert knowledge: a method of your own
## A method of your own

This is not in the curriculum, but it makes the code shorter.

Expand Down
2 changes: 1 addition & 1 deletion web/lessons/en/36-zahlenraten.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class GuessTheNumber {
`setEnabled(true)` switches a button back on. That way you can, for example, only allow a button once something has been entered.
:::

## Expert knowledge: winning in 7 guesses
## Winning in 7 guesses

::: angeberwissen
If you guess cleverly, you never need more than 7 guesses. Always guess the middle of the range that is left: first 50, then 25 or 75 and so on. Each guess halves the range: 100, 50, 25, 13, 7, 4, 2, 1. That is the **binary search** from lesson 19. Because 2 to the power of 7 = 128 is bigger than 100, 7 guesses are enough.
Expand Down
2 changes: 1 addition & 1 deletion web/lessons/en/37-viele-knoepfe-ein-zuhoerer.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Then make it better:
- for the extra, the display only shows stars but the code is still checked.

::: ludwig
For the calculator from lesson 35, one listener is enough for +, -, \* and / too. Check inside it with `e.getActionCommand().equals("+")` which operator was clicked.
In the branch for **OK**, count `attempts++` for every wrong code and then check `if (attempts >= 3)`. Then `ok.setEnabled(false)` switches the button off, like in the guessing game. For the stars: `input = input + e.getActionCommand();` and `display.setText(display.getText() + "*");`. Then you compare `input`, not the text of the display.
:::

## Checklist
Expand Down
2 changes: 1 addition & 1 deletion web/lessons/en/38-innere-klassen.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kurz: Write a listener as a named inner class, as an anonymous class and as a la
You already know the click counter from lesson 32. Today you write its listener in **three ways**, all of which do exactly the same:

1. as a **named inner class**, the way it was mostly done before Java 8,
2. as an **anonymous class**, which you know from the expert knowledge in lesson 30,
2. as an **anonymous class**, which you know from lesson 30 (“ActionListener is an interface”),
3. as a **lambda** with the arrow, as before.

In other people's code, in books and on the internet you will meet all three. After this lesson you will recognise them.
Expand Down
6 changes: 6 additions & 0 deletions web/lessons/en/aufgaben/einheitenrechner.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ public class Units {
}
```

**You are done when …**

- 1.5 shows "150.0 cm" after **in cm** and "1500.0 mm" after **in mm**,
- 1500 shows "1.5 km" after **in km**,
- "abc" in the field shows "Please enter a number" and the window stays open.

Extra: a fourth button **in feet** converts to the imperial unit. One foot is 0.3048 m.

::: ludwig
Expand Down
7 changes: 7 additions & 0 deletions web/lessons/en/aufgaben/wuerfel-mvc.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ Your task:
3. Write the view `StatsView`. It shows for example "Sixes: 2 of 10 rolls".
4. The controller is the listener at the button: it lets the model roll and hands the new values to both views.

**You are done when …**

- after ten rolls in the console `rolls` is 10 and `sixes` is between 0 and 10,
- every click on **Roll** shows a new number from 1 to 6 in the `PipsView`,
- the `StatsView` counts one more roll after every click and counts the sixes correctly,
- there is no `JLabel` in the model and no `Math.random` in the views.

Extra: a button **New game** resets everything. The method for that belongs in the model.

::: ludwig
Expand Down
2 changes: 1 addition & 1 deletion web/lessons/pt/04-variablen-und-datentypen.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ System.out.println("Total: " + precoTotal + " euros");
Como é que o computador entende o teu código Java e porque é que ele corre igual no Windows, no macOS e no Linux, vais ver na lição “Estrutograma e código”.

::: angeberwissen
O Java chamava-se primeiro **Oak** (carvalho), por causa da árvore em frente à janela do escritório de James Gosling. A partir de 1991, a sua equipa na Sun Microsystems queria programar pequenos aparelhos, como boxes de televisão. Mas o nome Oak já pertencia a outra empresa. Assim, em 1995 passou a chamar-se **Java**, como o café da ilha de Java. É por isso que o logótipo é uma chávena a fumegar.
O Java chamava-se primeiro **Oak** (carvalho), por causa da árvore em frente à janela do escritório de James Gosling. A partir de 1991, a sua equipa na Sun Microsystems queria programar pequenos aparelhos, como boxes de televisão. Mas o nome Oak já pertencia a outra empresa. Assim, em 1995 passou a chamar-se **Java**, como o café da ilha de Java.
:::

## Texto em Java
Expand Down
2 changes: 1 addition & 1 deletion web/lessons/pt/22-try-und-catch.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ try {

O Java não consegue converter “doze” e lança uma `NumberFormatException`. O programa escreve “Isto não é um número: doze”. Muda a primeira linha para `String entrada = "12";` e executa outra vez: agora aparece “Dobro: 24”.

## Saber de profissional: as exceções são objetos
## As exceções são objetos

Isto não está no programa da disciplina, mas é útil saber.

Expand Down
2 changes: 1 addition & 1 deletion web/lessons/pt/28-erstes-fenster.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Primeiro preparar, depois mostrar. Como no teatro: a cortina só sobe quando o p

Experimenta: apaga a linha com `setVisible(true)` e executa o programa outra vez. O programa corre, mas não vês nenhuma janela.

## Saber de profissional: classes e objetos
## Classes e objetos

Isto não está no programa da disciplina, mas ajuda-te a perceber o Swing.

Expand Down
2 changes: 1 addition & 1 deletion web/lessons/pt/30-der-knopf-reagiert.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ frage: Quantas linhas “Clique!” há depois na consola?
> O ouvinte corre a **cada** clique, não só no primeiro. Três cliques, três linhas.
:::

## Saber de profissional: ActionListener é uma interface
## ActionListener é uma interface

Isto não está no programa da disciplina. Se quiseres saber o que está por trás da seta, continua a ler.

Expand Down
2 changes: 1 addition & 1 deletion web/lessons/pt/35-taschenrechner.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ dividir.addActionListener(e -> {
Com `double` e `Double.parseDouble(…)` há casas decimais: 7 / 2 dá 3.5. Em contrapartida, com números decimais o Java não lança nenhuma exceção ao dividir por 0. O resultado é então `Infinity`, ou seja, “infinito”.
:::

## Saber de profissional: um método próprio
## Um método próprio

Isto não está no programa da disciplina, mas torna o código mais curto.

Expand Down
2 changes: 1 addition & 1 deletion web/lessons/pt/36-zahlenraten.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class AdivinhaNumero {
Com `setEnabled(true)` voltas a ligar um botão. Assim podes, por exemplo, só ativar um botão depois de alguém ter escrito alguma coisa.
:::

## Saber de profissional: ganhar com 7 tentativas
## Ganhar com 7 tentativas

::: angeberwissen
Quem adivinha com jeito nunca precisa de mais de 7 tentativas. Escolhe sempre o meio do intervalo que ainda resta: primeiro 50, depois 25 ou 75 e assim por diante. Cada palpite corta o intervalo a meio: 100, 50, 25, 13, 7, 4, 2, 1. É a **pesquisa binária** da lição 19. Como 2 elevado a 7 = 128 é maior do que 100, chegam 7 palpites.
Expand Down
2 changes: 1 addition & 1 deletion web/lessons/pt/37-viele-knoepfe-ein-zuhoerer.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Depois melhora-o:
- no extra, o visor só mostra estrelas mas o código continua a ser verificado.

::: ludwig
Também na calculadora da lição 35 chega um ouvinte para +, -, \* e /. Verifica lá dentro com `e.getActionCommand().equals("+")` que sinal de operação foi clicado.
No ramo do **OK**, conta `tentativas++` a cada código errado e depois verifica `if (tentativas >= 3)`. Aí `ok.setEnabled(false)` desliga o botão, como no Adivinha o número. Para as estrelas: `entrada = entrada + e.getActionCommand();` e `visor.setText(visor.getText() + "*");`. Depois comparas `entrada`, não o texto do visor.
:::

## Lista de verificação
Expand Down
2 changes: 1 addition & 1 deletion web/lessons/pt/38-innere-klassen.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kurz: Escrever um ouvinte como classe interna com nome, como classe anónima e c
O contador de cliques da lição 32 já conheces. Hoje escreves o seu ouvinte de **três maneiras**, que fazem todas exatamente o mesmo:

1. como **classe interna com nome**, como se fazia quase sempre antes do Java 8,
2. como **classe anónima**, que conheces do saber de profissional da lição 30,
2. como **classe anónima**, que conheces da lição 30 (“ActionListener é uma interface”),
3. como **lambda** com a seta, como até agora.

Em código de outras pessoas, em livros e na internet vais encontrar as três. Depois desta lição vais reconhecê-las.
Expand Down
6 changes: 6 additions & 0 deletions web/lessons/pt/aufgaben/einheitenrechner.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ public class Unidades {
}
```

**Terminaste quando …**

- 1.5 mostra "150.0 cm" depois de **em cm** e "1500.0 mm" depois de **em mm**,
- 1500 mostra "1.5 km" depois de **em km**,
- "abc" no campo mostra "Escreve um número" e a janela continua aberta.

Extra: um quarto botão **em pés** converte para a unidade inglesa. Um pé são 0.3048 m.

::: ludwig
Expand Down
7 changes: 7 additions & 0 deletions web/lessons/pt/aufgaben/wuerfel-mvc.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ A tua tarefa:
3. Escreve a view `VistaEstatistica`. Mostra por exemplo "Seis: 2 em 10 lançamentos".
4. O controller é o ouvinte do botão: manda o model lançar e passa os valores novos às duas views.

**Terminaste quando …**

- na consola, depois de dez lançamentos, `lancamentos` é 10 e `seis` está entre 0 e 10,
- cada clique em **Lançar** mostra um número novo de 1 a 6 na `VistaPontos`,
- a `VistaEstatistica` conta mais um lançamento depois de cada clique e conta bem os seis,
- no model não há nenhum `JLabel` e nas views não há nenhum `Math.random`.

Extra: um botão **Novo jogo** põe tudo no início. O método para isso pertence ao model.

::: ludwig
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.

Loading
Loading