Skip to content

Commit 2c64253

Browse files
committed
[add] an example for logical operators.
1 parent ebeb708 commit 2c64253

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This language is still currently experimental with many more features to come.
1919
* [Functions](examples/func.ls).
2020
* [Variables](examples/variable.ls).
2121
* [Conditionals](examples/conditionals.ls).
22-
* Logical operators.
22+
* [Logical operators](examples/logical.ls).
2323
* Loops.
2424
* Closures.
2525
* [Recursion](examples/recursion.ls).

examples/logical.ls

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var x = true;
2+
var y = false;
3+
4+
if (x and y) {
5+
print "x and y are both true";
6+
}
7+
8+
if (x or y) {
9+
print "Either x, y, or both are true!";
10+
}

0 commit comments

Comments
 (0)