Passes a boolean through unchanged, so a value can be given a name and reused.
Example: true -> true
The boolean
The same boolean
Draws a list of random booleans, each true with a given probability.
Example: length 5 with trueThreshold 0.7 -> perhaps [true, true, false, true, true]
How many booleans to draw and the probability of true
The random booleans
Turns numbers into booleans with a random blend between two thresholds.
Below the first threshold a number is always true, above the second always false; in between, the chance of true falls in steps from one to the other, so a pattern fades out instead of switching sharply. Example: [0.1, 0.9] with thresholds 0.3 and 0.7 -> [true, false]
The numbers, the two thresholds and how many steps the fade has
One boolean per number
Turns numbers into booleans: true below the threshold, false at or above it.
inverse flips every result.
Example: [0.3, 0.7, 0.5] with threshold 0.6 -> [true, false, true]
The numbers, the threshold and whether to flip the result
One boolean per number
Turns numbers into booleans: true when the number falls inside any of the given ranges, false otherwise.
Each range is [min, max] with both ends included; inverse flips every result.
Example: [0.2, 0.5, 0.8] with ranges [[0.3, 0.6], [0.7, 0.9]] -> [false, true, true]
The numbers, the ranges and whether to flip the result
One boolean per number
Flips a boolean: true becomes false and false becomes true.
Example: true -> false
The boolean
The opposite boolean
Flips every boolean in a list.
Example: [true, false, true] -> [false, true, false]
The booleans
Booleans and decisions: comparing values, flipping booleans, turning lists of numbers into lists of booleans by thresholds, drawing random booleans, and gating a value so it passes only when a condition holds. The threshold methods are the usual way to decide which items of a pattern get a feature and which do not.