Loops/Downward for: Difference between revisions

no edit summary
m (→‎{{header|AutoHotkey}}: Minor indentation and casing edit)
No edit summary
Line 200:
If the limit is less than the start, then FOR decrements the control variable. Otherwise, a fourth parameter could be given as a custom increment.
for [i 10 0] [print :i]
 
=={{header|Mathematica}}==
Mathematica provides several ways to iterate over a range of numbers, small subtle differences are amongst them. 3 possible implementations are (exactly same output):
 
Using For:
<lang Mathematica> For[i = 10, i >= 0, i--, Print[i]]</lang>
Using Do:
<lang Mathematica> Do[Print[i], {i, 10, 0, -1}]</lang>
Using Scan:
<lang Mathematica> Scan[Print, Range[10, 0, -1]]</lang>
 
=={{header|MAXScript}}==
1,111

edits