index based

New releases and general discussions.

Post » Tue Jul 28, 2009 11:42 pm

How about we get back to 0-index based and not 0-index based with some things with 1-index based which supposed to make things easier for new construct users but it doesnt seem to work pretty good also annoys people with basic programming knowlage.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Wed Jul 29, 2009 3:57 am

what?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Jul 29, 2009 9:40 am

I thought we all had discussed this in another thread... The point is to make everything uniform, as mixing 0-index and 1-index based features is too confusing, there would be MANY errors on the game developer's part. Imagine bug requests "MY GAEM NO WORK WYYYYYYY" etc. and it turns out some object is using different indexing etc.

You can always add -1 to the 1-indexed stuff to make it 0, but that'd be complicating it needlessly. Sometimes we have to agree on a standard to stick to. 1 indexing is the chosen one.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Wed Jul 29, 2009 5:09 pm

Everything in Construct should be 1-based (loops, lists, arrays etc) except where manually specified (eg. you can still specify a For loop to run from 0 to 9, it's not going to change that). If you find anything operating as 0-based, report it as a bug - obviously we don't want a mixed indexing standard!
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Wed Jul 29, 2009 6:03 pm

[quote="Ashley":108q00gm]Everything in Construct should be 1-based (loops, lists, arrays etc) except where manually specified (eg. you can still specify a For loop to run from 0 to 9, it's not going to change that). If you find anything operating as 0-based, report it as a bug - obviously we don't want a mixed indexing standard![/quote:108q00gm]
random() function reporting as bugged.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Wed Jul 29, 2009 6:31 pm

Oh... we had a discussion about that a while back, and decided not to change it. It'd break so many .caps in annoying ways. I think that one's the exception to the rule :P
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Wed Jul 29, 2009 7:10 pm

wait... how is random() bugged?
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Jul 29, 2009 7:30 pm

[quote="Davioware":g849ierh]wait... how is random() bugged?[/quote:g849ierh]

If you put random(10), it will return a number between 0 and 9 rather than 1 and 10. Though that's not so much bugged as it is a standard programming thing.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Wed Jul 29, 2009 9:40 pm

[quote="linkman2004":2dlnjuhp][quote="Davioware":2dlnjuhp]wait... how is random() bugged?[/quote:2dlnjuhp]

If you put random(10), it will return a number between 0 and 9 rather than 1 and 10. Though that's not so much bugged as it is a standard programming thing.[/quote:2dlnjuhp]
It should be index 1 based, i dont choose numbers to random pick, just range of numbers.

Edit:
Also if its index 0 based why it cant pick number 10 in random(10)
B
4
S
2
G
4
Posts: 719
Reputation: 2,938


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 4 guests