-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Boolean (data type)
Christoph Heine edited this page Jun 18, 2018
·
6 revisions
Boolean values are one of the primitive data types supported by nyan. A boolean can only be one of two possible values: True
or False
.
decision : bool = True
Unit():
convertible : bool
Spearman(Unit):
convertible = True
Ram(Unit):
convertible = False
The boolean value convertible
of the object Spearman
has the value True
, while the boolean convertible
of the object Ram
has the value False
.
Unit():
convertible : bool = False
Archer(Unit):
convertible = True
Overwrites the old value with a new one.
Ram():
convertible = False
Conformity<Ram>():
convertible &= True
If both the given and the original value are True
, the resulting value will also be True
, else the new value will be False
.
Ram():
convertible = False
Conformity<Ram>():
convertible |= True
If at least one of the two values is True
- i.e. the given value, the original value or both -, the resulting value will be True
. Only if both values are False
, the new value will also be False
.