Sorting Algorithms
Sorting is a simple but powerful concept. By taking an unorganized list of items, you can use an algorithm to sort them in a particular order. Although this idea might seem basic, sorting appears all throughout computer science in many different aspects and forms. One of the most important applications is in speeding up search. For example, your computer sorts files by name and size so you can quickly find the one you need. UEFN lets you sort objects in the Outliner by Type to group things together and organize your project. In Fortnite, players on the in-game scoreboard are sorted by many different stats like eliminations and lap time so everyone knows who's on top.
Applying sorting to Verse code can help you level up your gameplay and enhance aspects of your development. For instance, what about ordering an array of players by their score in a tournament, where the players who scored the least in each round get eliminated? By sorting this array at the end of each round, you can quickly find the lowest scorers and set them to spectators. On the other hand, you can just as quickly get the players with the best score and award them a bonus for the next round. You can even use this sorted list to create persistent local leaderboards, so players know who to watch out for during the game. And if you’ve got a list of people you’d like to shout out in your island, you can sort their names alphabetically for easy display.
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 your BrainDead.TV / BrainDeadGuild Discord account for full access.