0-indexed vs 1-indexed

New releases and general discussions.

Post » Fri Mar 06, 2009 11:19 am

[quote="Mipey":e4alzvpf]No, it doesn't include the 4. It is really a number from the array of {0,1,2,3}.

So a random(4) will return a whole number between 0 and 4, including the 0 and not including 4. Confusing, I know, but you get used to it.[/quote:e4alzvpf]

But it seems to me that "including 0" is not 1-indexed (start counting at 1).
What you describe, Mipey, is how most (all?) programming languages handle it, if I'm not mistaken.

Or is 1-indexed not implemented yet, in the latest stable build?
B
16
S
5
G
7
Posts: 599
Reputation: 5,000

Post » Mon Jan 31, 2011 7:48 am

Sorry to bump this, but this is just plain retarded. 1 based does not equal more intuitive, it does for some people, but a few people does not mean everybody. The logical choice is to let the user choose to use a 0 based or 1 based array, as certain situations arise where you WILL need a 0 based array, otherwise you will need use complex unnecessary math in order to get the desired result.
B
2
S
1
G
1
Posts: 38
Reputation: 676

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 1 guest