/
main.ts
48 lines (48 loc) · 1.35 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
radio.onReceivedNumber(function (receivedNumber) {
if (Werkzeug == 1) {
if (receivedNumber == 1) {
basic.showIcon(IconNames.Asleep)
} else if (receivedNumber == 2) {
basic.showIcon(IconNames.Sad)
} else {
basic.showIcon(IconNames.Happy)
}
} else if (Werkzeug == 2) {
if (receivedNumber == 1) {
basic.showIcon(IconNames.Happy)
} else if (receivedNumber == 2) {
basic.showIcon(IconNames.Asleep)
} else {
basic.showIcon(IconNames.Sad)
}
} else if (Werkzeug == 3) {
if (receivedNumber == 1) {
basic.showIcon(IconNames.Sad)
} else if (receivedNumber == 2) {
basic.showIcon(IconNames.Happy)
} else {
basic.showIcon(IconNames.Asleep)
}
}
})
input.onButtonPressed(Button.B, function () {
Werkzeug = randint(1, 3)
if (Werkzeug == 1) {
basic.showIcon(IconNames.Scissors)
} else if (Werkzeug == 2) {
basic.showIcon(IconNames.SmallDiamond)
} else {
basic.showLeds(`
. . . . .
. # # # .
. # # # .
. # # # .
. . . . .
`)
}
basic.pause(2000)
radio.sendNumber(Werkzeug)
})
// Kinder können sich eine Funkgruppe aussuchen
let Werkzeug = 0
radio.setGroup(2)