posted 8 years ago
I've written a game, and I'm trying to figure out if I'm using a data structure, or if not, exactly how one would describe the way I'm using data. Here's how it works:
I conceptualize the following set of 81 integers as being organized in a grid:
11 12 13 14 15 16 17 18 19
21 22 23 24 25 26 27 28 29
etc.
91 92 93 94 95 96 97 98 99
I flip a coin, and if it's heads, I can use any one column of numbers, for instance, 6, 16, 26, 36, 46, etc., or 1, 11, 21, etc. Which column I use is decided randomly, after the coin is flipped.
If it's tails, I can use one row: 91-99, etc., or 41-49, etc.
I'm wondering if the number grid is a data structure, because 1) I'm not loading anything into memory, and 2) the "data" is just natural numbers, as opposed to file names, phone numbers, product prices, etc. that are created and deliberately stored for retrieval.
It feels like a data structure, because 1) with each coin flip, the integers are structured in a certain way for that coin flip, and I can only access it in a certain way --- either a column of numbers or a row of numbers, and 2) although there are an infinite number of integers, I only have possible access to 81 of them.
So, if there's a name for this approach, I'd be grateful to know what it is. Maybe I actually am using a data structure.
Act boldly, and unforseen forces will come to your aid.