-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
37 lines (37 loc) · 773 Bytes
/
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
input.onButtonPressed(Button.A, function () {
if (x > 0) {
basic.showString("A")
}
if (x < 5) {
basic.showString("B")
}
if (x >= 15) {
basic.showString("C")
}
basic.showString("D")
})
input.onButtonPressed(Button.AB, function () {
if (x < 0) {
basic.showString("A")
if (x > -5) {
basic.showString("B")
}
} else if (x < 5) {
basic.showString("C")
} else {
basic.showString("D")
}
})
input.onButtonPressed(Button.B, function () {
if (x <= 0) {
basic.showString("A")
} else if (x > 2) {
basic.showString("B")
} else if (x < 9) {
basic.showString("C")
} else {
basic.showString("D")
}
})
let x = 0
x = -6