Navigation: nimCSO (core library) | Changelog | nimcso/bitArrayAutoconfigured
Procs
func firstFalse(b: BitArray): (bool, int) {....raises: [], tags: [], forbids: [].}
- Returns the value and position of the first false bit in BitArray. Source Edit
proc styledEcho(b: BitArray) {....raises: [IOError, ValueError], tags: [WriteIOEffect], forbids: [].}
- Prints the BitArray in a stylish way, with 1s in bright green and 0s in dim red. Source Edit
proc styledEchoAnnotated(b: BitArray) {....raises: [IOError, ValueError], tags: [WriteIOEffect], forbids: [].}
- Prints the BitArray in a stylish way, with (1) top annotation of the index like | 0| 1| 2| ... |10|11| ..., (2) side annotation of the lenght of the array, and (3) 1s in bright green and 0s in dim red. Source Edit
func toBoolArray(b: BitArray): array[elementN, bool] {....raises: [], tags: [], forbids: [].}
- Converts the BitArray to an array of bools. Source Edit
func toSetPositions(b: BitArray): seq[int] {....raises: [], tags: [], forbids: [].}
- Converts the BitArray to a sequence of positions of the true bits. Source Edit
func unsafeSetFalse(b: var BitArray; i: int) {....raises: [], tags: [], forbids: [].}
- Set a single bit to false (unchecked) of the BitArray at position i. Source Edit
func unsafeSetTrue(b: var BitArray; i: int) {....raises: [], tags: [], forbids: [].}
- Set a single bit to true (unchecked) of the BitArray at position i. Source Edit