And

From MiniScript Wiki
Revision as of 19:18, 29 January 2025 by FR-b0n5a1 (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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