Skip to main content

Mojo function

shuffle

shuffle[T: Copyable, //](mut list: List[T])

Shuffles the elements of the list randomly.

Performs an in-place Fisher-Yates shuffle on the provided list.

Parameters:

  • T (Copyable): The type of element in the List.

Args:

  • list (List): The list to modify.

Was this page helpful?