📖 Read the detailed guide for hand-written examples and background.
public tuple bitset(int val)
Bitset represents a fixed-size sequence of BITSET_SIZE bits. The bits are contained in a single int.
public function emptyBitset() returns bitset
Creates an empty bitset.
public function bitsetToIndex(bitset object) returns int
public function bitsetFromIndex(int index) returns bitset
public function bitset.get(int index) returns bool
Returns the value of the bit with the specified index.
public function bitset.set(int index) returns bitset
Sets the bit at the specified index to true.
public function bitset.reset(int index) returns bitset
Sets the bit at the specified index to false.
public function bitset.set(int index, bool value) returns bitset
Sets the bit at the specified index to the specified value.
public function bitset.flip(int index) returns bitset
Sets the bit at the specified index to the complement of its current value.
public function bitset.isEmpty() returns bool
Returns true if this bitset contains no bits that are set to true.
public function bitset.intersects(bitset other) returns bool
Returns true if the specified bitset has any bits set to true that are also set to true in this bitset.
public function bitset.bitAnd(bitset other) returns bitset
Performs a logical AND of this bit set with the bit set argument.
public function bitset.bitOr(bitset other) returns bitset
Performs a logical OR of this bit set with the bit set argument.
public function bitset.bitXor(bitset other) returns bitset
Performs a logical XOR of this bit set with the bit set argument.
public function bitset.toInt() returns int
Returns an integer representation of the data.
public constant BITSET_SIZE = 32