-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample-makecode.typ
More file actions
50 lines (46 loc) · 1.36 KB
/
Copy pathexample-makecode.typ
File metadata and controls
50 lines (46 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// MakeCode blocks: the micro:bit editor's look, and the Calliope mini colours.
//
// The same notation as scratch(). Block texts are the editors' own, in
// German (default) or English; `ende` closes a C-block, `ansonsten` opens
// the else branch. Unknown labels are drawn as written with the category
// from a `::kategorie` suffix.
#import "@preview/blockst:0.4.1": makecode, raw-makecode
#set page(width: auto, height: auto, margin: 4mm, fill: none)
#show: raw-makecode(language: "en")
#let programm = "
beim Start
zeige Symbol [Herz v]
setze [zähler v] auf (0)
ende
wenn Knopf [A v] geklickt
zeige LEDs [#...#|.#.#.|..#..|.#.#.|#...#]
spiele (Melodie [C D E F - - - -] mit Tempo (120) (bpm)) [bis zum Ende v]
ändere [zähler v] um (1)
zeige Zahl (zähler)
wenn <(zähler) > (9)> dann
zeige Text [Fertig!]
setze [zähler v] auf (0)
ansonsten
pausiere (ms) (100)
ende
ende
"
#grid(
columns: 3,
column-gutter: 7mm,
row-gutter: 2mm,
align: top + left,
text(size: 8pt, fill: gray)[makecode (micro:bit)], text(size: 8pt, fill: gray)[makecode-calliope], text(size: 8pt, fill: gray)[makecode · en],
makecode(programm),
makecode(programm, profile: "makecode-calliope"),
[
```microbit
forever
show number (((1) + (2)) * (3))
if <not <button [A v] is pressed>> then
show icon [Heart v]
end
end
```
],
)