Computer Science Canada 2D arrays |
Author: | MysticVegeta [ Mon Mar 07, 2005 6:47 pm ] |
Post subject: | 2D arrays |
I know what 2D arrays are but i have a question on hwo to use them, for example if i have a 2D array, how do i get them to match each other for example : 1st -> 1st 1st -> 2nd 1st -> 3rd 2nd -> 1st 2nd -> 2nd 2nd -> 3rd 3rd -> 1st 3rd -> 2nd 3rd -> 3rd Match each other, hard to understand?? =S |
Author: | person [ Mon Mar 07, 2005 6:49 pm ] |
Post subject: | |
wat does -> mean? |
Author: | Flikerator [ Mon Mar 07, 2005 8:18 pm ] |
Post subject: | |
person wrote: wat does -> mean?
I think it means "=". |
Author: | ssr [ Mon Mar 07, 2005 8:59 pm ] |
Post subject: | |
do u get the question though? umm do u wanna replace all the values in the array that has the index with the same values? ummm ![]() |
Author: | Flikerator [ Mon Mar 07, 2005 9:28 pm ] | ||
Post subject: | |||
Now they all equal 1. Is that what you wanted? Not sure what is meant by 2D array (Never heard of them). |
Author: | person [ Mon Mar 07, 2005 9:30 pm ] |
Post subject: | |
2D arrays r arrays wich r stored in an array...i know someone (probably Cervantes) wrote a tutorial on it...all i remember was wat 2D arrays r and that it was a good tutorial |
Author: | Bacchus [ Mon Mar 07, 2005 9:51 pm ] | ||||
Post subject: | |||||
ex)
|
Author: | person [ Tue Mar 08, 2005 3:32 pm ] |
Post subject: | |
![]() btw: ur not limited to just 2 dimensions, u can go all the way to watever if u like but that would be confusing and....(i digress)...... |
Author: | Token [ Tue Mar 08, 2005 3:50 pm ] |
Post subject: | |
okay now i have a question, is it possible to have a string variable inside an integer variable, or vice versa? like for example a high score, i would want to store the persons username and then theyre score, i could put them both into a string array but then i wouldent be able to sort them unless i used the strint function, any ideas? |
Author: | Bacchus [ Tue Mar 08, 2005 4:58 pm ] | ||
Post subject: | |||
i sugest using records
|
Author: | Flikerator [ Wed Mar 09, 2005 4:06 pm ] |
Post subject: | |
Its easy to suggest records when you don't explain how to use them ![]() Yah after I asked what 2D arrays where I read a tutorial on them...Thanks though ![]() Records are VERY useful with arrays/flexible arrays. |
Author: | Bacchus [ Wed Mar 09, 2005 4:38 pm ] | ||
Post subject: | |||
srry i think kinda wierd and in my own way so i dont think to explain things at first
as an example you would do: player(1).name:="Bob" player(1).score:=13 that way 'Bob' would have a score of '13' sotred under the same variable, you can make a type by using records (pretty sure in tutorial) and u can even use records in records if you wanted to. just an easy way to store sub variable uynder one name to keep track of them |
Author: | MysticVegeta [ Fri Mar 11, 2005 7:18 pm ] | ||||
Post subject: | |||||
Bacchus wrote: ex)
Yea its something like that but if the first array is 2, 4, 5, 6, 3 and the second array is 3, 2, 5, 6, 1 then if 2 matches 3 then do blah 2 matches 2 then do blah 2 matches 5 then do blah 2 matches 6 then do blah 2 matches 1 then do blah 4 matches 3 then do blah 4 matches 2 then do blah 4 matches 5 then do blah 4 matches 6 then do blah 4 matches 1 then do blah 5 matches 3 then do blah 5 matches 2 then do blah 5 matches 5 then do blah 5 matches 6 then do blah 5 matches 1 then do blah =S |
Author: | Bacchus [ Fri Mar 11, 2005 7:28 pm ] | ||
Post subject: | |||
try nested for loops
|
Author: | MysticVegeta [ Fri Mar 18, 2005 5:39 pm ] |
Post subject: | |
cool thanks ![]() |