Loops/Continue: Difference between revisions
Content deleted Content added
m Use simple 'for' |
→{{header|Suneido}}: ++ sather |
||
Line 589: | Line 589: | ||
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|Sather}}== |
|||
There's no <code>continue!</code> in Sather. The code solve the task without forcing a new iteration. |
|||
<lang sather>class MAIN is |
|||
main is |
|||
i:INT; |
|||
loop i := 1.upto!(10); |
|||
#OUT + i; |
|||
if i%5 = 0 then |
|||
#OUT + "\n"; |
|||
else |
|||
#OUT + ", "; |
|||
end; |
|||
end; |
|||
end; |
|||
end;</lang> |
|||
=={{header|Suneido}}== |
=={{header|Suneido}}== |
||
Line 608: | Line 624: | ||
6,7,8,9,10 |
6,7,8,9,10 |
||
ok</lang> |
ok</lang> |
||
'''Bold text''' |
|||
=={{header|Tcl}}== |
=={{header|Tcl}}== |