#jagged arrays, lists and classes

1 messages · Page 1 of 1 (latest)

sour crane
#

so that means either classes or a list of lists is the best way to store? the only way as of now that I have a remote idea of how to do it is by using a triple jagged array

#

jagged arrays, lists and classes

#

@robust prism I'm not quite sure what you mean with classes for this purpose

#

do I just google classes in general and I should be able to understand?

robust prism
sour crane
#

ah

#

alright so I guess I gotta learn about classes

#

now that I say it out loud I wonder how I got so far without knowing what classes are

#

if I split them into classes, I still have to create a list right?

#

or at least a single array?

robust prism
#

ye

sour crane
#

because the amount of elements is unknown, and up to the user to create

#

it would be amazing if there were some way for the code to just auto-create more variables ;-;

#

after storing the data I also need to be able to sort the data by the int size, and pull the corresponding group and bus name too

#

so I'm guessing the class can store more than just the array, such as a string for the name, right? which I can then pull later

robust prism
#

yes

sour crane
#

alright, I'll give this a shot for now, although I have no idea what I'm mostly doing

robust prism
sour crane
#

time for mr google to hold my hand

sour crane
#

both should be usable, right?

#

I kinda wanna stick to arrays because it's what I'm used to, but lists seem better fit for the task

robust prism
#

there isn't really any good reason to use an array. A list does the same but better

sour crane
#

mhm. so I guess I'll make 3 classes, and fill them each with a list corresponding to the data type: group, bus or timeslot

#

then I can create an instance of the class and fill it with data as the user creates more of the items?

robust prism
#

ye pretty much

sour crane
#

alright I think I got the basic idea down, so I should be able to figure things out on my own

#

hopefully