VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse Community Snippets›Verse Language·Up to Community Snippets · Verse Language·3 of 114 in Verse Language

Shuffling Arrays

2752 Views

Report

  • FisherYatesShuffle(Source:[]int)<transacts>:[]int =
        var ShaffleDeck :[]int = Source #1
        for:
            Head := 0..ShaffleDeck.Length-2 #2
            RandomNumber := GetRandomInt(Head, ShaffleDeck.Length-1) #3
            Temp := ShaffleDeck[Head] #4
            set ShaffleDeck[Head] = ShaffleDeck[RandomNumber]
            set ShaffleDeck[RandomNumber] = Temp
        do:
    
        return ShaffleDeck
    

    FisherYatesShuffle(Source:[]int)<transacts>:[]int = var ShaffleDeck :[]int = Source #1 for: Head := 0..ShaffleDeck.Length-2 #2 RandomNumber := GetRandomInt(Head, ShaffleDeck.Length-1) #3 Temp := ShaffleDeck[Head] #4 set ShaffleDeck[Head] = ShaffleDeck[RandomNumber] set ShaffleDeck[RandomNumber] = Temp do: return ShaffleDeck

    Expand code Copy full snippet(11 lines long)

  • |  |  |
    | --- | --- |
    |  | FisherYatesShuffle(Source:[]int)<transacts>:[]int = |
    |  | var ShaffleDeck :[]int = Source |
    |  | for: |
    |  | Head := 0..ShaffleDeck.Length-1 |
    |  | RandomNumber := GetRandomInt(Head, ShaffleDeck.Length-1) |
    |  | Result := ShaffleDeck[RandomNumber] |
    |  | set ShaffleDeck[RandomNumber] = ShaffleDeck[Head] |
    |  | do: |
    |  | Result |
    

You're reading a preview

The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.

Sign in with Discord — free for members Read the original at Epic Games documentation

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

Keep exploring
More in Verse Language · 3 of 114
Prev
fortnite graphs
Next
fortnite grant exp on a tagged collectible coin

Source

Epic Games documentation

View original

Last updated 2026-07-26T12:47:07.038994+00:00

VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

🦜

Scout · your island guide

The Isle of Verse