How does For loop works

Get help using Construct 2

Post » Sat Mar 01, 2014 5:13 pm

Code:
For "test" from 1 to 0 invokes two actions.
For "test" from 1 to -1 invokes three actions. etc.

Is this a bug or it should work like this ? I rather expect that "for loop" like this doesn't invoke any action.
B
9
S
2
G
1
Posts: 44
Reputation: 730

Post » Sat Mar 01, 2014 5:42 pm

loops can go to negative values,
ImageImageImageImage
B
157
S
64
G
41
Posts: 2,590
Reputation: 34,640

Post » Sat Mar 01, 2014 5:55 pm

Zero is the absence of a number, like darkness is the absence of light. We give the word "darkness" to describe the absence, and in the same way we (and computers) must have a way of demonstrating the absence of a number. Because of this, zero is counted with or without going into negatives.
B
25
S
6
G
6
Posts: 262
Reputation: 3,690

Post » Sat Mar 01, 2014 6:06 pm

Nope.
0 is both a number and the numerical digit used to represent that number in numerals. It fulfills a central role in mathematics as the additive identity of the integers, real numbers, and many other algebraic structures. As a digit, 0 is used as a placeholder in place value systems.

I don't know about Programming though.
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests