View Source Adept.List (adept v0.1.0)
Link to this section Summary
Functions
Randomize the order of a list.
Splits the list into n new lists organized into columns
Generate a list of arbirary length randomly sampled from a source list.
Link to this section Functions
Randomize the order of a list.
@spec split_columns(items :: list(), count :: pos_integer()) :: list()
Splits the list into n new lists organized into columns
example
Example
iex> Adept.Map.split_columns( [1,2,3,4,5,6,7,8,9], 3 )
[[1,4,7], [2,5,8], [3,6,9]]
@spec take_random(list :: list(), length :: pos_integer()) :: list()
Generate a list of arbirary length randomly sampled from a source list.
Items in the source list can be repeated in the final list, since they are randomly sampled.
Unlike Enum.take, take_random can generate a new list that is longer than the source list.