Skip to content
This repository was archived by the owner on Nov 7, 2026. It is now read-only.

Commit 18057f0

Browse files
committed
VisuBot: Symbole für jede Befehlsgruppe (Palette + Nachschlagen)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ugz28VNUeu1hn8zWaCPkwJ
1 parent 4f36096 commit 18057f0

11 files changed

Lines changed: 146 additions & 128 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The format is loosely inspired by Keep a Changelog.
88

99
### Changed
1010

11-
- **Web 0.14.28, VisuBot commands grouped by colour:** in the palette every mBot2 box gets a 4 px stripe on the left and every group heading a dot in the colour of its group: driving and wheels orange, light (LEDs) yellow-green, sound magenta, screen and emotions indigo, waiting and stopwatch grey, all sensors turquoise. The boxes themselves stay yellow (statement), and the structure chart and the code are unchanged. The former group „Licht, Ton und Bildschirm“ is split into „Licht“, „Ton“ and „Bildschirm“ in the palette and in the VisuBot Nachschlagen (de/en), whose `###` headings show the same dots. New lesson syntax `### Überschrift {.klasse}`. With „Blöcke farbig“ off, stripes and dots disappear.
11+
- **Web 0.14.28, VisuBot commands grouped by colour:** in the palette every mBot2 box gets a 4 px stripe on the left and every group heading a dot in the colour of its group: driving and wheels orange, light (LEDs) yellow-green, sound magenta, screen and emotions indigo, waiting and stopwatch grey, all sensors turquoise. The boxes themselves stay yellow (statement), and the structure chart and the code are unchanged. The former group „Licht, Ton und Bildschirm“ is split into „Licht“, „Ton“ and „Bildschirm“ in the palette and in the VisuBot Nachschlagen (de/en), whose `###` headings show the same dots. New lesson syntax `### Überschrift {.klasse}`. With „Blöcke farbig“ off, stripes and dots disappear. Every sub-group also gets a symbol in the palette (all languages) and in the Nachschlagen headings: 🚗 driving, ⚙️ wheels, 💡 LEDs, 🔊 sound, 🖥️ screen, 😊 emotions, ⏱️ waiting, 📏 distance, ➖ line, 🎨 colours, 🕹️ buttons/joystick, 🔆 light/loudness, 📐 tilt, 🔋 stopwatch/battery.
1212
- **Web 0.14.27, VisuBot: `forward`/`backward` overloaded with a unit:** besides `mbot.forward()` (10 cm) and `mbot.forward(30)` there is now `mbot.forward(2, "Umdrehungen")` and `mbot.forward(30, "cm")` (en `"rotations"`, pt `"rotações"`), same for `backward`. One wheel rotation is π · 6.5 cm ≈ 20.4 cm; the action stores the distance in cm, so simulation, exercise check and the real robot (`mbot2.straight`) work unchanged, and the console shows e.g. „2 Umdrehungen vorwärts (40.84 cm)“. An unknown unit is an error naming the allowed units. The CyberPi program export gets the same overload. VisuBot lesson 22 gets a step „Gleicher Name, andere Parameter: Überladung“ with the three headers, a Ludwig Angeberwissen asking pupils to measure their own robot with a printable test record (PDF, de/en, `website/visubot/messprotokoll-radumdrehung.pdf` / `test-record-wheel-rotation.pdf`: wheel diameter, five test cases expected vs. actual, evaluation, causes, feedback for the teacher, box „So testet man Softwaresysteme“), the exercise „Quadrat mit Umdrehungen“ and a quiz; Nachschlagen, glossary („Überladung“) and code completion list the new variants (de/en).
1313
- **Web 0.14.26, animation: nested loop fills a times table in lesson 14:** in step „Schleife in der Schleife“, after the triangle example (which keeps the names `zeile`/`stern`), a new sentence says experienced programmers call the counters `i` and `j`, followed by an animated structure chart: the active block lights up, a variables box shows `i`, `j` and `text` (pt `texto`), and the console fills line by line with `1 2 3 4`, `2 4 6 8`, `3 6 9 12`. It shows that `j` starts again at 1 on every new line. Plays once when visible, „Noch einmal abspielen“ replays it (de/en/pt).
1414
- **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/lessons/de/visubot/nachschlagen.md‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Ein Befehl sagt dem mBot2, was er **tun** soll. Jeder Befehl beginnt mit `mbot.` und endet mit Klammern. In die Klammern schreibst du oft eine Zahl.
44

5-
### Fahren und Drehen {.bot-fahren}
5+
### 🚗 Fahren und Drehen {.bot-fahren}
66

77
Der mBot2 fährt geradeaus oder dreht sich auf der Stelle.
88

@@ -24,7 +24,7 @@ mbot.turnRight(180) dreht sich ganz um
2424
2525
> Für ein Vieleck dreht er sich insgesamt einmal ganz herum: Dreieck 3 × 120°, Quadrat 4 × 90°, Sechseck 6 × 60°.
2626
27-
### Räder einzeln {.bot-fahren}
27+
### ⚙️ Räder einzeln {.bot-fahren}
2828

2929
Hier gibst du jedem Rad selbst Gas. Die Zahlen sind Prozent: 100 ist volles Gas, 0 ist Stillstand, eine Zahl mit Minus fährt rückwärts. Der mBot2 fährt so lange weiter, bis ein anderer Fahrbefehl kommt.
3030

@@ -35,7 +35,7 @@ mbot.drive(40, -40) ein Rad vor, eins zurück: dreht sich
3535
mbot.stop() hält an
3636
```
3737

38-
### Licht {.bot-licht}
38+
### 💡 Licht {.bot-licht}
3939

4040
Der mBot2 hat fünf LEDs mit den Nummern 0 bis 4.
4141

@@ -48,23 +48,23 @@ mbot.led(0).setColor("aus") nur LED 0 aus
4848

4949
Bei `setLed` mischst du Rot, Grün und Blau, jedes von 0 (aus) bis 255 (ganz hell).
5050

51-
### Ton {.bot-ton}
51+
### 🔊 Ton {.bot-ton}
5252

5353
```
5454
mbot.playTone(440, 300) spielt einen Ton
5555
```
5656

5757
Die erste Zahl ist die Tonhöhe. Je größer, desto höher. Die zweite Zahl ist die Länge in Millisekunden (1000 Millisekunden sind 1 Sekunde).
5858

59-
### Bildschirm {.bot-anzeige}
59+
### 🖥️ Bildschirm {.bot-anzeige}
6060

6161
```
6262
mbot.showText("Hallo") zeigt Hallo auf dem Bildschirm
6363
```
6464

6565
Mit `+` hängst du Text und Zahlen aneinander: `mbot.showText("Abstand: " + mbot.getDistance())`.
6666

67-
### Gefühle {.bot-anzeige}
67+
### 😊 Gefühle {.bot-anzeige}
6868

6969
Der mBot2 zeigt ein Gefühl mit Licht, Ton und Wackeln. Das siehst du nur am echten mBot2.
7070

@@ -76,7 +76,7 @@ mbot.emotion("wow") staunt
7676

7777
Weitere Gefühle: hello, yeah, proud, yummy, naughty, uh_oh, hurt, angry, startle, shiver, dizzy, sleepy, zzz, wake_up, blink, yes, no, look_up, look_down, look_left, look_right, look_around
7878

79-
### Warten und Stoppuhr {.bot-warten}
79+
### ⏱️ Warten und Stoppuhr {.bot-warten}
8080

8181
```
8282
mbot.pause(1000) wartet 1 Sekunde
@@ -89,7 +89,7 @@ Die Zeit der Stoppuhr liest du mit dem Sensor `mbot.getTimer()` (unten bei **Sto
8989

9090
Ein Sensor **misst** etwas und gibt dir einen Wert zurück. Den Wert benutzt du in einer Bedingung, zum Beispiel in einer Schleife oder Verzweigung. Manche Sensoren liefern eine **Zahl**, manche **wahr oder falsch**, einer einen **Text**.
9191

92-
### Abstand {.bot-sensor}
92+
### 📏 Abstand {.bot-sensor}
9393

9494
Der Ultraschallsensor vorn misst, wie weit die nächste Wand weg ist, in Zentimetern.
9595

@@ -99,7 +99,7 @@ mbot.getDistance() > 15 ist vorn mehr als 15 cm frei?
9999
int abstand = mbot.getDistance() Abstand in einer Variablen merken
100100
```
101101

102-
### Linie {.bot-sensor}
102+
### ➖ Linie {.bot-sensor}
103103

104104
Unter dem mBot2 sitzen vier Fühler. Sie sehen, ob der Boden schwarz ist.
105105

@@ -111,7 +111,7 @@ mbot.isLineLeft() sieht der linke mittlere Fühler Schwarz?
111111
mbot.isLineRight() sieht der rechte mittlere Fühler Schwarz?
112112
```
113113

114-
### Farben {.bot-sensor}
114+
### 🎨 Farben {.bot-sensor}
115115

116116
Derselbe Sensor unten erkennt auch Farben. `mbot.getColor()` gibt dir den Namen der Farbe als Text: `"rot"`, `"grün"`, `"blau"`, `"gelb"`, `"weiß"` oder `"schwarz"`.
117117

@@ -122,7 +122,7 @@ mbot.getColor().equals("rot") steht er auf Rot?
122122

123123
> Texte vergleichst du mit `.equals(…)`, nicht mit `==`. Das `!` davor heißt **nicht**.
124124
125-
### Tasten und Joystick {.bot-sensor}
125+
### 🕹️ Tasten und Joystick {.bot-sensor}
126126

127127
Auf dem CyberPi gibt es die Tasten A und B und einen kleinen Joystick. Jeder Sensor sagt **wahr**, solange gedrückt wird.
128128

@@ -135,14 +135,14 @@ mbot.isJoystickLeft() Joystick nach links gedrückt?
135135
mbot.isJoystickRight() Joystick nach rechts gedrückt?
136136
```
137137

138-
### Licht und Lautstärke {.bot-sensor}
138+
### 🔆 Licht und Lautstärke {.bot-sensor}
139139

140140
```
141141
mbot.getBrightness() wie hell? 0 ist dunkel, 100 ist hell
142142
mbot.getLoudness() wie laut? 0 ist still, 100 ist laut
143143
```
144144

145-
### Neigung und Schütteln {.bot-sensor}
145+
### 📐 Neigung und Schütteln {.bot-sensor}
146146

147147
```
148148
mbot.getPitch() nach vorn oder hinten gekippt? (in Grad)
@@ -152,7 +152,7 @@ mbot.isShaken() wird er geschüttelt?
152152

153153
> Liegt der mBot2 flach, sind beide Neigungen 0. In der Simulation stellst du diese Werte unter **🎛 Sensoren ausprobieren** ein.
154154
155-
### Stoppuhr und Akku {.bot-sensor}
155+
### 🔋 Stoppuhr und Akku {.bot-sensor}
156156

157157
```
158158
mbot.getTimer() Sekunden seit dem Start oder seit resetTimer()

‎web/lessons/en/visubot/nachschlagen.md‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A command tells the mBot2 what to **do**. Every command starts with `mbot.` and ends with brackets. Often you write a number in the brackets.
44

5-
### Driving and turning {.bot-fahren}
5+
### 🚗 Driving and turning {.bot-fahren}
66

77
The mBot2 drives straight or turns on the spot.
88

@@ -24,7 +24,7 @@ mbot.turnRight(180) turns all the way round
2424
2525
> For a polygon it turns all the way round once in total: triangle 3 × 120°, square 4 × 90°, hexagon 6 × 60°.
2626
27-
### Wheels separately {.bot-fahren}
27+
### ⚙️ Wheels separately {.bot-fahren}
2828

2929
Here you give each wheel gas yourself. The numbers are percent: 100 is full gas, 0 is standing still, a number with a minus drives backwards. The mBot2 keeps going until another driving command comes.
3030

@@ -35,7 +35,7 @@ mbot.drive(40, -40) one wheel forward, one back: it turns
3535
mbot.stop() stops
3636
```
3737

38-
### Light {.bot-licht}
38+
### 💡 Light {.bot-licht}
3939

4040
The mBot2 has five LEDs with the numbers 0 to 4.
4141

@@ -48,23 +48,23 @@ mbot.led(0).setColor("off") only LED 0 off
4848

4949
With `setLed` you mix red, green and blue, each from 0 (off) to 255 (very bright).
5050

51-
### Sound {.bot-ton}
51+
### 🔊 Sound {.bot-ton}
5252

5353
```
5454
mbot.playTone(440, 300) plays a tone
5555
```
5656

5757
The first number is the pitch. The bigger, the higher. The second number is the length in milliseconds (1000 milliseconds are 1 second).
5858

59-
### Screen {.bot-anzeige}
59+
### 🖥️ Screen {.bot-anzeige}
6060

6161
```
6262
mbot.showText("Hello") shows Hello on the screen
6363
```
6464

6565
With `+` you join text and numbers: `mbot.showText("Distance: " + mbot.getDistance())`.
6666

67-
### Emotions {.bot-anzeige}
67+
### 😊 Emotions {.bot-anzeige}
6868

6969
The mBot2 shows a feeling with light, sound and wiggling. You only see it on the real mBot2.
7070

@@ -76,7 +76,7 @@ mbot.emotion("wow") is amazed
7676

7777
More feelings: hello, yeah, proud, yummy, naughty, uh_oh, hurt, angry, startle, shiver, dizzy, sleepy, zzz, wake_up, blink, yes, no, look_up, look_down, look_left, look_right, look_around
7878

79-
### Waiting and stopwatch {.bot-warten}
79+
### ⏱️ Waiting and stopwatch {.bot-warten}
8080

8181
```
8282
mbot.pause(1000) waits 1 second
@@ -89,7 +89,7 @@ You read the stopwatch time with the sensor `mbot.getTimer()` (below under **Sto
8989

9090
A sensor **measures** something and gives you a value back. You use the value in a condition, for example in a loop or a branch. Some sensors give a **number**, some **true or false**, one gives a **text**.
9191

92-
### Distance {.bot-sensor}
92+
### 📏 Distance {.bot-sensor}
9393

9494
The ultrasonic sensor at the front measures how far away the next wall is, in centimetres.
9595

@@ -99,7 +99,7 @@ mbot.getDistance() > 15 is there more than 15 cm free ahead?
9999
int distance = mbot.getDistance() remember the distance in a variable
100100
```
101101

102-
### Line {.bot-sensor}
102+
### ➖ Line {.bot-sensor}
103103

104104
Under the mBot2 there are four probes. They see whether the floor is black.
105105

@@ -111,7 +111,7 @@ mbot.isLineLeft() does the left middle probe see black?
111111
mbot.isLineRight() does the right middle probe see black?
112112
```
113113

114-
### Colours {.bot-sensor}
114+
### 🎨 Colours {.bot-sensor}
115115

116116
The same sensor underneath also recognises colours. `mbot.getColor()` gives you the name of the colour as text: `"red"`, `"green"`, `"blue"`, `"yellow"`, `"white"` or `"black"`.
117117

@@ -122,7 +122,7 @@ mbot.getColor().equals("red") is it standing on red?
122122

123123
> You compare texts with `.equals(…)`, not with `==`. The `!` in front means **not**.
124124
125-
### Buttons and joystick {.bot-sensor}
125+
### 🕹️ Buttons and joystick {.bot-sensor}
126126

127127
On the CyberPi there are the buttons A and B and a small joystick. Each sensor says **true** while it is being pressed.
128128

@@ -135,14 +135,14 @@ mbot.isJoystickLeft() joystick pushed left?
135135
mbot.isJoystickRight() joystick pushed right?
136136
```
137137

138-
### Light and loudness {.bot-sensor}
138+
### 🔆 Light and loudness {.bot-sensor}
139139

140140
```
141141
mbot.getBrightness() how bright? 0 is dark, 100 is bright
142142
mbot.getLoudness() how loud? 0 is silent, 100 is loud
143143
```
144144

145-
### Tilt and shaking {.bot-sensor}
145+
### 📐 Tilt and shaking {.bot-sensor}
146146

147147
```
148148
mbot.getPitch() tipped forward or back? (in degrees)
@@ -152,7 +152,7 @@ mbot.isShaken() is it being shaken?
152152

153153
> When the mBot2 lies flat, both tilts are 0. In the simulation you set these values under **🎛 Try the sensors**.
154154
155-
### Stopwatch and battery {.bot-sensor}
155+
### 🔋 Stopwatch and battery {.bot-sensor}
156156

157157
```
158158
mbot.getTimer() seconds since the start or since resetTimer()

‎web/src/ui/app.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { progress } from '../learn/progress'
4444
import { codeKeywords, currentLanguage, offeredLanguages, setCodeKeywords, setLanguage, t, type LanguageCode } from './i18n'
4545
import * as Export from './exporter'
4646
import { SimulationPanel } from './simulationPanel'
47-
import { mbotLinkText, setVisuBotMode, setVisuFlowWorld, setVisuObjectWorld, visuBotBrand, toggleMBotLink, visuBotEnabled, visuBotGroupColor, visuBotMode, visuBotSensors, visuBotTemplates, VisuBotView, worldChooserHTML, worldChosen, type WorldChoice } from './visubotView'
47+
import { mbotLinkText, setVisuBotMode, setVisuFlowWorld, setVisuObjectWorld, visuBotBrand, toggleMBotLink, visuBotEnabled, visuBotGroupColor, visuBotGroupIcon, visuBotMode, visuBotSensors, visuBotTemplates, VisuBotView, worldChooserHTML, worldChosen, type WorldChoice } from './visubotView'
4848
import { canConnectMBot, mbotLink } from '../core/mbotLink'
4949
import { uploadToMBot } from './mbotUpload'
5050
import { lessons, tasks, useVisuBotContent, world } from '../learn/content'
@@ -747,7 +747,7 @@ export class App {
747747
li.dataset.botColor = visuBotGroupColor(group)
748748
const button = document.createElement('button')
749749
button.type = 'button'
750-
button.textContent = t(`web_visubot_group_${group}`)
750+
button.textContent = [visuBotGroupIcon[group], t(`web_visubot_group_${group}`)].filter(Boolean).join(' ')
751751
const show = (open: boolean) => {
752752
button.setAttribute('aria-expanded', String(open))
753753
for (const item of list.querySelectorAll<HTMLElement>(`[data-group="${group}"]`)) item.hidden = !open

‎web/src/ui/visubotView.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,24 @@ export function visuBotGroupColor(group: string): string {
458458
return colors[group] ?? 'sensor'
459459
}
460460

461+
/** Symbol jeder Gruppe (Palette und Nachschlagen): Symbole merkt man sich leichter als viele Farbtöne. */
462+
export const visuBotGroupIcon: Record<string, string> = {
463+
drive: '🚗',
464+
wheels: '⚙️',
465+
leds: '💡',
466+
sound: '🔊',
467+
screen: '🖥️',
468+
emotion: '😊',
469+
wait: '⏱️',
470+
distance: '📏',
471+
line: '➖',
472+
color: '🎨',
473+
buttons: '🕹️',
474+
light: '🔆',
475+
tilt: '📐',
476+
timer: '🔋',
477+
}
478+
461479
/** Sensoren: Werte, die die Schüler selbst in eine Bedingung einbauen (`mbot.getDistance() < 20`). */
462480
export const visuBotSensors: { key: string; group: string; text: string }[] = [
463481
{ key: 'web_visubot_sensor_distance', group: 'distance', text: 'mbot.getDistance()' },

0 commit comments

Comments
 (0)