Skip to content

Commit 55eb725

Browse files
authored
Mo logic
1 parent 021fc39 commit 55eb725

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lessons/logic.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ if (1 + 1 == 2 && 3 + 3 == 6) {
4242
System.out.println("Math is still mathin'");
4343
}
4444
```
45+
Variables can be used in `if` statements as well, assuming that they are `boolean`'s.
46+
```java
47+
boolean valid = 1 == 1;
48+
if (valid) {
49+
System.out.println("1 == 1 Yay");
50+
}
51+
```
4552
```java
4653
if (motorRunning && desiredMotorState == MotorState.kSTOP) {
4754
motor.Set(0);

0 commit comments

Comments
 (0)