Skip to main content

Mojo function

shuffle

shuffle[T: Copyable & Movable, //](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 & Movable): The type of element in the List.

Args:

  • list (List[T]): The list to modify.

Was this page helpful?