3 ms·
How does this loop work ?Does this create an array where B,F,Z,D and i are 0? for(T=[B=F=Z=D=i=0];i<600;i++)
by neals 12y ago
How does this loop work ?Does this create an array where B,F,Z,D and i are 0?
for(T=[B=F=Z=D=i=0];i<600;i++)
- delan 12y agoThe loop first sets B, F, Z, D and i all to zero. Then it sets T to a new array containing one element, zero. The key here is that = is a right-associative expression operator which yields the right operand.
- dorgo 12y agoI would say: T is an array containing one element which is zero.
- zaroth 12y agoImage the '0' walking left, because it as to follow the =, everything it touches on that path, turns to zero and disappears. What are you left with? Just '0'. The block quotes provide containment.
- derekp7 12y agoTo expand on the other explanations, this can be: T=[0],B=0,F=0,Z=0,D=0,i=0