Array manual question.

Get help using Construct 2

Post » Sat Jun 18, 2016 6:25 pm

I am learning how to use arrays. The manual seems to be saying something that is contradictory. Am I missing something or is it describing "push front" and "push back" in the exact same way?

(The following is a copy from the online manual.)

Manipulating arrays

A one-dimensional array, sized N x 1 x 1, serves as a simple list of N values. The actions in the Manipulation category (e.g. Push, Pop) allow one-dimensional arrays to be used like other data structures. (These actions work with multidimensional arrays, but are intended for the one-dimensional case.)

For example, the following scheme implements a queue (first in first out, or 'FIFO'):
•Add new items with Push front
•Retrieve the next value with Array.Back
•Remove the retrieved value with Pop back

The following scheme implements a stack (last in first out, or 'LIFO'):
•Add new items with Push back
•Retrieve the next value with Array.Back
•Remove the retrieved value with Pop back
B
42
S
20
G
6
Posts: 106
Reputation: 6,567

Post » Sat Jun 18, 2016 6:40 pm

And the question is ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sat Jun 18, 2016 7:57 pm

I think I misunderstood what the manual is actually saying. The emphasis is on the whether the example is a queue or a stack and where the new items initially go. Front or back. The retrieving location is the same in both examples.

My mistake. I think I get it now.
B
42
S
20
G
6
Posts: 106
Reputation: 6,567


Return to How do I....?

Who is online

Users browsing this forum: Karpakis and 10 guests