-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81b8df4
commit 51baea0
Showing
3 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Sample Vint program demonstrating logical operators | ||
|
||
// Define a function to test 'and', 'or', and 'not' | ||
let test_logical_operators = func () { | ||
// Testing 'and' operator | ||
let result_and = and(true, false) // Should return false | ||
print("Result of true AND false: ", result_and) | ||
|
||
// Testing 'or' operator | ||
let result_or = or(false, true) // Should return true | ||
print("Result of false OR true: ", result_or) | ||
|
||
// Testing 'not' operator | ||
let result_not = not(true) // Should return false | ||
print("Result of NOT true: ", result_not) | ||
} | ||
|
||
// Call the function to test the logical operators | ||
test_logical_operators() |