Loops/Wrong ranges: Difference between revisions

→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)"
(→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)")
Line 2,393:
Start equal stop equal zero: zero increment ------ 0 0 0 0 0 0 0 0 0 0</pre>
 
=={{header|V (Vlang)}}==
Vlang has only one loop, a 'for' statement, which supports six different syntactical forms commonly found in other C-family languages:
 
Line 2,410:
It appears that either #5 fits the requirements of this task so I've translated a function which generates the appropriate sequence using #1 (limited to a maximum of 10 elements as some sequences will be infinite). I've then applied #5 to the resulting sequence. All sequences include the stop value if it's actually reached.
{{trans|Go}}
<syntaxhighlight lang="v (vlang)">struct Seq {
start int
stop int
451

edits