docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Permutation

    Permutation(int)

    Generates a permutation of the integers from 0 to n-1.

    Declaration
    public static int[] Permutation(int n)
    Parameters
    Type Name Description
    int n

    Size of the permutation array to generate

    Returns
    Type Description
    int[]

    Permutation array

    Remarks

    Uses Knuth/Fisher-Yates shuffles: https://en.wikipedia.org/wiki/Random_permutation#Fisher-Yates_shuffles

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)