Computer Science Canada An array of an array |
Author: | mwachna [ Tue Mar 01, 2005 1:27 pm ] |
Post subject: | An array of an array |
Ok...i have 3 parametres...first is the subject, topic, and days needed to cover the topic. each are represened by int's. subject=3 topic(subject(1))=3; topic(subject(2))=2; topic(suject(3))=1 days(t(s(1))(1))=2 %this means that the days needed to cover the 1st topic of the first subject is 2; days(t(s(1))(2))=1; days(t(s(1))(3))=1 days(t(s(2))(1))=4; days(t(s(2))(2))=2 days(t(s(3))(1))=8 so ideally i would like to call upon a variable, lets call it "AtClass" in the form of "AtClass(S,T,D)" %haha...STD not intentional i would like this variable to contain the number of students in class. so if AtClass(2,1,3)=10, that would mean that 10 children were presend for the 3rd day of the first topic covered in subject 1. basically i want to do: var AtClass: array of 1..3, 1..(topics for subject of the first parametre), 1..(days for the topic # of the second parameter for the subject of the first parameter) of int sorry this is really hard to describe |
Author: | Tony [ Tue Mar 01, 2005 1:29 pm ] |
Post subject: | |
yes |
Author: | jamonathin [ Tue Mar 01, 2005 2:21 pm ] |
Post subject: | |
lol, yeah, whatever your code is, use the code tools, so then it wont look like a bunch of letters bunched together, and we can deciefer between everthing. |
Author: | person [ Tue Mar 01, 2005 3:48 pm ] |
Post subject: | |
i really dont get ur problem...but maybe im the only one lost? |
Author: | Flikerator [ Tue Mar 01, 2005 4:11 pm ] | ||
Post subject: | |||
Use a record with an array. If I understand the problem clearly use them. There are two tutorials in the tutorials section on both.
Looks something like that, manipulate it as you please. |
Author: | mwachna [ Tue Mar 01, 2005 7:48 pm ] | ||
Post subject: | in code... | ||
here, this is what i have for a temporary code: (to animate a dance step)
|
Author: | Flikerator [ Tue Mar 01, 2005 7:51 pm ] |
Post subject: | |
When submitting code make sure to put on "Code" Format... and include the vars >.< |
Author: | Bacchus [ Tue Mar 01, 2005 9:15 pm ] |
Post subject: | |
so if im understanding this right... you want an array with a sub-array that has a sub-array? [code]var blah:array 1..x,1..x,1..x of watever[code] or if you wanted one array but with different subheadings: [code]var blah:array 1..x of record a:int b:string end record[/code] |
Author: | mwachna [ Wed Mar 02, 2005 1:16 am ] | ||
Post subject: | arrays | ||
Well i more want to have an array of an array, but i want to set the parametres seperately for each part of the array. If i wanted to do it the long and complex way, we would be looking at something like this:
as you can see...its way to much variable declaration and if i wanted to output one of these variables depending on an independent condition i would have to create the world's largest if statement. There has to be away for me to group these together into some kind of array so that i can just say "put Toltal(x)(y)(z)" or "put Total(x,y,z)" where x y an z are variables with values generated from an independent event. if this doesn't clear things up, don't worry about it. I will hammer things out edvintually. |
Author: | Tony [ Wed Mar 02, 2005 9:59 am ] | ||
Post subject: | |||
just wondering... has a thought of trying out the code ever occured to you? What you're trying to do is compleatly legal.
|
Author: | Ayoun [ Sun Mar 06, 2005 12:29 pm ] |
Post subject: | ur so dumn |
damn you stupid people!!! ![]() |
Author: | Flikerator [ Sun Mar 06, 2005 3:20 pm ] |
Post subject: | Re: ur so dumn |
Ayoun wrote: damn you stupid people!!!
![]() err? What is that supposed to mean. "Oh no someone doesnt know something".. |
Author: | mwachna [ Mon Mar 07, 2005 11:21 am ] |
Post subject: | |
I have found a solution to the problem...for better understanding, and an answer to my problem, check out the tutorial: "arrays of arrays and more arrays." |