September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,9 @@
begin
i_w := 1; s_w := 0; % set output format %
for i := 1 until 10 do begin
writeon( i );
if i rem 5 = 0
then write()
else writeon( ", " )
end for_i
end.

View file

@ -0,0 +1,7 @@
for i to 10 do
write( i );
if i % 5 = 0
then write( "\n" )
else write( ", " )
fi
od

View file

@ -0,0 +1,10 @@
OPTION EXPLICIT
DIM i AS INTEGER
CLS
FOR i = 1 TO 10
PRINT STR$(i);
IF (i MOD 5) THEN PRINT ","; ELSE PRINT
NEXT i
END

View file

@ -0,0 +1,5 @@
10 FOR I = 1 to 10
20 PRINT I;
30 IF INT(I/5) = I/5 THEN PRINT : GOTO 50
40 PRINT ", ";
50 NEXT

View file

@ -0,0 +1,6 @@
10 FOR I=1 TO 10
20 PRINT I;
30 IF I/5=INT (I/5) THEN PRINT
40 IF I/5=INT (I/5) THEN NEXT I
50 PRINT ", ";
60 NEXT I

View file

@ -0,0 +1,9 @@
for (i = 1; i <= 10; i++) {
print i
if (i % 5) {
print ", "
continue
}
print "\n"
}
quit

View file

@ -0,0 +1,11 @@
( 0:?i
& whl
' ( 1+!i:~>10:?i
& put
$ ( str
$ ( !i
(mod$(!i.5):0&\n|", ")
)
)
)
);

View file

@ -0,0 +1,12 @@
1 si # i = 1
[2Q]sA # A = code to break loop
[[, ]P 1J]sB # B = code to print comma, continue loop
[
li n # print i
li 5 % 0 !=B # call B if i % 5
[
]P # print newline
M # mark from calling B
li 1 + si # i += 1
li 10!<C # continue loop if 10 >= i
]sC li 10!<C # enter loop if 10 >= i

View file

@ -0,0 +1,10 @@
Public Sub Main()
Dim siCount As Short
For siCount = 1 To 10
Print siCount;
If siCount <> 5 And siCount <> 10 Then Print ",";
If siCount = 5 Then Print gb.NewLine;
Next
End

View file

@ -0,0 +1,11 @@
// version 1.1.2
fun main(args: Array<String>) {
for(i in 1 .. 10) {
if (i % 5 == 0) {
println(i)
continue
}
print("$i, ")
}
}

View file

@ -0,0 +1,7 @@
> n, 1..10
s += n
? n%5, s += ", "
>> n%5
#.output(s)
s = ""
<

View file

@ -0,0 +1,13 @@
! Loops/Continue - simula67 - 07/03/2017;
begin
integer i;
for i:=1 step 1 until 10 do begin
outint(i,5);
if mod(i,5)=0 then begin
outimage;
goto loop
end;
outtext(", ");
loop:
end
end

View file

@ -0,0 +1,8 @@
forvalues n=1/10 {
display `n' _continue
if mod(`n',5)==0 {
display
continue
}
display ", " _continue
}

View file

@ -0,0 +1,14 @@
DECLARE @i INT = 0;
DECLARE @str VarChar(40) = '';
WHILE @i<10
BEGIN
SET @i = @i + 1;
SET @str = @str + CONVERT(varchar(2),@i);
IF @i % 5 = 0
BEGIN
PRINT @str;
SET @str =''
CONTINUE;
END
SET @str = @str +', ';
END;

View file

@ -0,0 +1,2 @@
foreach n in ([1..10]){print(n); if(n%5==0){println(); continue;} print(", ")}
// or foreach n in ([1..10]){print(n,(n%5) and ", " or "\n")}