Hi folks! Today we’re going to dive into the warm tropical waters of basic computer science data structures! “But Seth, I thought UBot Studio required no programming experience!” That’s true, but programming knowledge, in any form, will make you a better botter. Besides, this is easier stuff, so quit complaining.
Queues and Stacks
As you already know, in UBot Studio, we have lists. In computer science, we also have lists. But computer science also gives us some variations of lists that come in handy in certain situations. One such variation is called a stack.
In a stack, you can only add new items to the top. When we add new items to the top, we “push” the item from the stack. When we “pop” an item from a stack, we’re removing the top item and returning it. You can imagine the stack of dirty magazines. When a new dirty magazine arrives in the mail, you “push” it to the top of the stack. When you’re ready to look at a dirty magazine, you “pop” the topmost magazine, read it for the articles, and promptly discard it. Or if you prefer, it’s how a cat eats pancakes.