Advanced Data Structures (ADS) is a library of custom blocks that allow Scratch developers to create, save, and modify array lists and doubly linked lists using Scratch's native variable system. ADS lists are able to do things that basic Scratch lists can't, which includes appending lists, constructing nested lists, and copying lists. _________ QUICK START GUIDE ______________ This project contains 5 different versions of the ADS library, some of which contain smaller sets of blocks to reduce editor lag. To start using ADS, backpack the sprite titled "ADS AL". This sprite contains all array list operations, which will allow you to do everything that you can normally do with a basic Scratch list at the same time complexity, and also gives you access to a lot of things you CAN'T normally do in scratch. Since the library requires about 30 custom blocks, it will probably be easier to start making your project inside a copy of ADS AL, rather than copying everything to an already existing sprite. ADS AL contains two "Construct" functions, which each make a new list. The first one creates a list of a given length filled entirely with the same element, and the second one turns a text string into a list. For example, Construct( length=(3), populateWith=(0) ) and Construct( string=(0, 0, 0) ) both create the list [0, 0, 0]. How do you access this list? Every ADS sublibrary has its own return variable, which stores the output of the most recent function. The return variable for AL is named ADS.AL.return. When you use a constructor function, it returns a pointer to the list you constructed. This pointer is then used inside of ADS methods to modify and access the list you created. The sprite titled "ADS examples" shows several examples for how this all works for every block in the ADS library. Use the toScratchList() method to easily visualize the lists you create.
Leave a comment if you need help or if you find any bugs! Also, if you're disappointed that a library called "advanced data structures" only contains two of the simplest non-primitive data types, don't worry! I have big plans for future versions of ADS... Version 1.1 Released 8/22/2025 - New "Any" block added to apply a method to an object without needing to know what the type of that object is beforehand. - Recursive deepDelete(), deepCopy(), and equals?() method added for both list types.