1. For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
    Dismiss Notice
  1. Programmatic

    Programmatic Steampunker

    So I got bored and decided to make a sorting machine in Terraria. The device uses a sorting algorithm called "bubble sort," in which each item in a list is compared with the one before it, swapping them if they are out of order. The algorithm compares every pair of items before performing the entire process again, repeating until the list is fully sorted. Overall, bubble sort is actually one of the least efficient sorting algorithms, but, being one of the simplest, it wasn't too difficult to create a compact version in Terraria.

    Here's an example of me using the device to sort the numbers 31 through 0 into the correct order (lists in completely reverse order are the slowest to process with bubble sort, so the process can't take any longer than this):

    Also, here's the world file in case you want to test it yourself:

    Attached Files:

  2. that's impressively fast for it being the *slowest* it can be
  3. MadmanLava

    MadmanLava Spazmatism

    I don't really understand the video. What is it sorting and what do the colors mean?
  4. Programmatic

    Programmatic Steampunker

    The device is sorting an array of 32 binary numbers from least to greatest. By colors, I assume you mean the rainbow torches. Those are there to indicate the value of each binary number.
  5. idkwhoiam129

    idkwhoiam129 Steampunker

    oh awesome! Now I challenge you to do a recursive merge sort haha! :p