Partition Array

Pure
PartitionArray

Splits an array into two arrays: values less than pivot and values greater than or equal.

Type: Pure (no side effects)
Category: Fortuna|Array & Collection
Keywords: array & collection

Inputs

NameTypeDefaultDescription
ArrayTArray<int>Array parameter
PivotValueintPivotValue parameter

Outputs

NameTypeDescription
LessThanTArray<int>LessThan output
GreaterOrEqualTArray<int>GreaterOrEqual output

Example Use Cases

Example 1

Separate enemies into close-range and long-range groups.

Example 2

Split items by rarity threshold.