-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Boolean (data type)
Christoph Heine edited this page Mar 29, 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
.