Loops/Continue: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 562: | Line 562: | ||
Without meeting the criteria (showing loop continuation), this task could be written as: |
Without meeting the criteria (showing loop continuation), this task could be written as: |
||
<lang ruby>1.upto(10) {|i| print "%d%s" % [i, i%5==0 ? "\n" : ", "]}</lang> |
<lang ruby>1.upto(10) {|i| print "%d%s" % [i, i%5==0 ? "\n" : ", "]}</lang> |
||
=={{header|Suneido}}== |
|||
<lang Suneido>ob = Object() |
|||
for (i = 1; i <= 10; ++i) |
|||
{ |
|||
ob.Add(i) |
|||
if i is 5 |
|||
{ |
|||
Print(ob.Join(',')) |
|||
ob = Object() |
|||
} |
|||
} |
|||
Print(ob.Join(','))</lang> |
|||
Output: |
|||
<lang Suneido>1,2,3,4,5 |
|||
6,7,8,9,10 |
|||
ok</lang> |
|||
=={{header|Tcl}}== |
=={{header|Tcl}}== |