Game Design Foundations (Wordware Game and Graphics Library)

The first concept we will examine is called a “stack” or a “queue.” A checkout line in a grocery store opens up, and there is no one in the line. A customer enters the line, and the cashier begins to ring him up. Another customer enters the line behind the first customer, and then another customer enters the end of the line behind the second customer. The first customer pays for his groceries and leaves. The second customer is rung up as another customer enters the end of the line.

This everyday occurrence is known as a queue or a stack, where the first person in line is the first person processed. We call this FIFO or First In, First Out.

FIFO’s cousin is FILO, or First In, Last Out, which occurs in situations like cooking pancakes. The first pancake is nice and brown and is tossed onto a plate. The next pancake is finished and tossed on top of the first pancake. Another pancake is cooked and tossed on top of the second pancake. Then you sit down at the kitchen table ready to eat the fruits (or pancakes) of your labor. The first pancake you begin to eat is the last pancake you cooked (the pancake on top). The next pancake you eat is the second one cooked, and the last pancake eaten is the first one cooked. This method is an example of FILO; the first pancake cooked is the last one eaten.

Категории