pxt-calliope/docs/reference/logic.md

40 lines
415 B
Markdown
Raw Normal View History

2016-04-06 08:11:48 +02:00
# Logic
2016-04-13 17:27:45 +02:00
[if](/reference/logic/if)
2016-04-06 08:11:48 +02:00
```blocks
if(true) {
}
```
2016-04-13 17:27:45 +02:00
[Boolean](/reference/types/boolean) values: *true*; *false*
2016-04-06 08:11:48 +02:00
```blocks
true
false
```
Boolean binary operators: *and* (conjunction); *or* (disjunction)
```blocks
true && false;
true || false;
```
Boolean negation operator
```blocks
!true
```
Comparison operators (=, !=, <, >, <=, >=)
```blocks
0 == 0;
1 !- 0;
0 < 1;
1 > 0;
0 <= 1;
1 >= 0;
```