Skip to main content
Log in

Mojo function

shuffle

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

Shuffles the elements of the list randomly.

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

Parameters:

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

Args:

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