Quick array questions, help!

For questions about using Classic.

Post » Wed Sep 03, 2008 10:11 pm

Is a 13x13 array in reality a 14x14 array? Or Construct automatically counts the 0?

Does the array counting starts from 0?

Should the depth be 1 or 0 for a 2d array?
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Wed Sep 03, 2008 10:21 pm

As it stands, the array is 0-based, so a 10x10 array would have elements 0-9. I think this should be changed to be 1-based. Do you agree?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Wed Sep 03, 2008 10:24 pm

[quote="Ashley":3i3tzonb] Do you agree?[/quote:3i3tzonb]
maybe a tickbox? :mrgreen:
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Wed Sep 03, 2008 10:24 pm

[quote="Ashley":2zuhlx6o]As it stands, the array is 0-based, so a 10x10 array would have elements 0-9. I think this should be changed to be 1-based. Do you agree?[/quote:2zuhlx6o]
I absolutely disagree. Everyone that ever programmed something, even in Visual Basic, will except a 0-based array. I was just asking ;)
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Wed Sep 03, 2008 11:04 pm

What about the depth? 0 or 1? Help
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Wed Sep 03, 2008 11:20 pm

The depth should be 1 for Z for a 2D array - 0 elements would mean the array has 0 elements in total (x size * y size * z size = 0 if any dimension is 0).
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests