Lists
Making a list
Lists are easy way of organizing information. The actual list is the where information is inputted. In Scratch a list can be made by clicking on, "data" and "make a list." From there you can name the list to describe the data that will be inserted. Once a basic list is created, additional code can be created to organize the code to best suit its purpose.
Sorting a list
To sort a list, the code needs to have variables. Four main variables are needed: swap space, check here, index, and index of best so far. The index is the place of where a certain phrase or word is in in the list. The next variable, check here, is the line that the code is comparing. Anytime it sees a low number or letter such as 1 or A, it is set as index of best so far. From there that entry is copied to the variable swap space. This allows the lower number to switch places with the higher number without copying or deleting data entries.
Lists in action
This is an example of one of the organizers I made. Before the code starts phrases insert phrases or words into the list, "words." When the code is run the list is organized into ABC order. The code works by starting at the top of the list. It compares the current place of the word and to where it should be. The code knows that A should be at the top because A = 1 and Z = 26. 1 Is greater lesser so the code copies the word or phrase and places it higher in the list. Next, the code moves down to the next word where it compares again. Once it reaches the bottom it will be organized into ABC order.