langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
|
|
@ -0,0 +1 @@
|
|||
for (i = 2; i <= 8; i +=2)
|
||||
|
|
@ -0,0 +1 @@
|
|||
foreach (i in [2, 4 .. 8])
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref savelog symbols nobinary
|
||||
|
||||
say
|
||||
say 'Loops/For with a specified step'
|
||||
|
||||
loop i_ = -1.4 to 10.6 by 1.7
|
||||
say i_.format(3, 1) || '\0'
|
||||
end i_
|
||||
say
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# let for_step a b step fn =
|
||||
let rec aux i =
|
||||
if i <= b then begin
|
||||
fn i;
|
||||
aux (i+step)
|
||||
end
|
||||
in
|
||||
aux a
|
||||
;;
|
||||
val for_step : int -> int -> int -> (int -> 'a) -> unit = <fun>
|
||||
|
||||
# for_step 0 8 2 (fun i -> Printf.printf " %d\n" i) ;;
|
||||
0
|
||||
2
|
||||
4
|
||||
6
|
||||
8
|
||||
- : unit = ()
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
for(i := 0; i < 10; i += 2;) {
|
||||
i->PrintLine();
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
for i = 1:2:10
|
||||
disp(i)
|
||||
endfor
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
/* Loop from 3 to 9 in steps of 2 */
|
||||
|
||||
for ( l = [3:2:9] ) {
|
||||
echo (l);
|
||||
}
|
||||
echo ("on a double white line.");
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
for I in 2..8;2 do
|
||||
{System.show I}
|
||||
end
|
||||
{System.show done}
|
||||
|
|
@ -0,0 +1 @@
|
|||
forstep(n=1,10,2,print(n))
|
||||
|
|
@ -0,0 +1 @@
|
|||
forstep(n=1,100,[2,4,2,2],print(n))
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
declare (n, i) fixed binary;
|
||||
|
||||
get list (n);
|
||||
do i = 1 to n by 4;
|
||||
put skip list (i);
|
||||
end;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
for 2, 4 ... 8 {
|
||||
print "$_, ";
|
||||
}
|
||||
|
||||
say 'whom do we appreciate?';
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
int main() {
|
||||
for(int i = 2; i <= 16; i=i+2) {
|
||||
write(i + "\n");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
for ($i = 0; $i -lt 10; $i += 2) {
|
||||
$i
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
For i=-15 To 25 Step 5
|
||||
Debug i
|
||||
Next i
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
for i 2 8 2 [
|
||||
prin rejoin [i ", "]]
|
||||
print "who do we appreciate?"
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
for i = 2 to 8 step 2
|
||||
print i; ", ";
|
||||
next i
|
||||
print "who do we appreciate?"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
data _null_;
|
||||
do i=1 to 10 by 2;
|
||||
put i;
|
||||
end;
|
||||
run;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
for (x; 2; x <= 8; 2)
|
||||
print(x, ", ");;
|
||||
print("who do we appreciate?\n");
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
$ include "seed7_05.s7i";
|
||||
|
||||
const proc: main is func
|
||||
local
|
||||
var integer: number is 0;
|
||||
begin
|
||||
for number range 1 to 10 step 2 do
|
||||
writeln(number);
|
||||
end for;
|
||||
end func;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
2 to: 8 by: 2 do: [| :i | Console ; i printString ; ', '].
|
||||
inform: 'enough with the cheering already!'.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Local i
|
||||
For i, 0, 100, 5
|
||||
Disp i
|
||||
EndFor
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
$$ MODE TUSCRIPT
|
||||
LOOP i=2,9,2
|
||||
PRINT i
|
||||
ENDLOOP
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
x=2
|
||||
while test $x -le 8; do
|
||||
echo $x
|
||||
x=`expr $x + 2` || exit $?
|
||||
done
|
||||
|
|
@ -0,0 +1 @@
|
|||
for x in `jot - 2 8 2`; do echo $x; done
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
for (( x=2; $x<=8; x=$x+2 )); do
|
||||
printf "%d, " $x
|
||||
done
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
foreach x (`jot - 2 8 2`)
|
||||
echo $x
|
||||
end
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
for (#1 = 1; #1 < 10; #1 += 2) {
|
||||
Num_Type(#1)
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
for(i = 2, i <= 8, i = i + 2){
|
||||
i.print()
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
include c:\cxpl\codes;
|
||||
int I;
|
||||
[for I:= 2 to 8 do
|
||||
[IntOut(0, I); Text(0, ", ");
|
||||
I:= I+1;
|
||||
];
|
||||
Text(0, "who do we appreciate?");
|
||||
]
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
10 FOR l = 2 TO 8 STEP 2
|
||||
20 PRINT l; ", ";
|
||||
30 NEXT l
|
||||
40 PRINT "Who do we appreciate?"
|
||||
Loading…
Add table
Add a link
Reference in a new issue