Difference between revisions of "And"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>and</c> is a keyword for logical binary operator of conjunction (and) of [https://en.wikipedia.org/wiki/Boolean_algebra boolean algebra]. It evaluate...")
(No difference)

Revision as of 19:18, 29 January 2025

and is a keyword for logical binary operator of conjunction (and) of boolean algebra. It evaluates two operands and returns true only when both operands are true, else it returns false.

Examples

print false and false // output : 0
print false and true  // output : 0
print true and false  // output : 0
print true and true   // output : 1

a = true
b = false
c = true
print a and b // output : 0
print b and c // output : 0
print a and c // output : 1

minimum = 3
maximum = 7
A = 4
B = 9
print A > minimum and A < maximum // output : 1
print B > minimum and B < maximum // output : 0