-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ts
90 lines (90 loc) · 2.11 KB
/
main.ts
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
let zahl = 0
input.onButtonEvent(Button.A, input.buttonEventClick(), function () {
for (let index = 0; index < 2; index++) {
basic.showString("hallo paul")
basic.pause(500)
}
music.playMelody("C5 B A G F E D C ", 136)
basic.showString("hi!")
basic.showLeds(`
# # # # #
# . . . #
# . # . #
# . . . #
# # # # #
`)
basic.showNumber(5000)
basic.showString("hallo papa hallo mama hallo emil")
music.playMelody("C5 A B G A F G E ", 136)
})
input.onButtonEvent(Button.B, input.buttonEventClick(), function () {
input.calibrateCompass()
basic.showIcon(IconNames.Yes)
basic.showLeds(`
# # . # .
# # # # .
. # # # #
# # # # #
. . # # #
`)
basic.showString("was ist die gefärlichste sport art der welt")
})
input.onGesture(Gesture.Shake, function () {
zahl = randint(1, 6)
if (zahl == 1) {
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
} else if (zahl == 2) {
basic.showLeds(`
. . # . .
. . . . .
. . . . .
. . . . .
. . # . .
`)
} else if (zahl == 3) {
basic.showLeds(`
# . . . .
. . . . .
. . # . .
. . . . .
. . . . #
`)
} else if (zahl == 4) {
basic.showLeds(`
# . . . #
. . . . .
. . . . .
. . . . .
# . . . #
`)
} else if (zahl == 5) {
basic.showLeds(`
# . . . #
. . . . .
. . # . .
. . . . .
# . . . #
`)
} else {
basic.showLeds(`
# . # . #
. . . . .
. . . . .
. . . . .
# . # . #
`)
}
basic.pause(500)
basic.showNumber(zahl)
})
basic.forever(function () {
for (let Index = 0; Index <= 255; Index++) {
basic.setLedColor(basic.rgb(10, 0, 0))
}
})