langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
6
Task/Loops-Do-while/Nemerle/loops-do-while.nemerle
Normal file
6
Task/Loops-Do-while/Nemerle/loops-do-while.nemerle
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
mutable x = 0;
|
||||
do
|
||||
{
|
||||
x++;
|
||||
WriteLine($"$x");
|
||||
} while (x % 6 != 0)
|
||||
11
Task/Loops-Do-while/NetRexx/loops-do-while.netrexx
Normal file
11
Task/Loops-Do-while/NetRexx/loops-do-while.netrexx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref savelog symbols nobinary
|
||||
|
||||
say
|
||||
say 'Loops/Do-while'
|
||||
|
||||
i_ = 0
|
||||
loop until i_ // 6 = 0
|
||||
i_ = i_ + 1
|
||||
say i_
|
||||
end
|
||||
7
Task/Loops-Do-while/OCaml/loops-do-while-1.ocaml
Normal file
7
Task/Loops-Do-while/OCaml/loops-do-while-1.ocaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
let rec loop i =
|
||||
let i = succ i in
|
||||
Printf.printf "%d\n" i;
|
||||
if i mod 6 <> 0 then
|
||||
loop i
|
||||
in
|
||||
loop 0
|
||||
7
Task/Loops-Do-while/OCaml/loops-do-while-2.ocaml
Normal file
7
Task/Loops-Do-while/OCaml/loops-do-while-2.ocaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
let do_while f p =
|
||||
let rec loop() =
|
||||
f();
|
||||
if p() then loop()
|
||||
in
|
||||
loop()
|
||||
(** val do_while : (unit -> 'a) -> (unit -> bool) -> unit *)
|
||||
3
Task/Loops-Do-while/OCaml/loops-do-while-3.ocaml
Normal file
3
Task/Loops-Do-while/OCaml/loops-do-while-3.ocaml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
let v = ref 0 in
|
||||
do_while (fun () -> incr v; Printf.printf "%d\n" !v)
|
||||
(fun () -> !v mod 6 <> 0)
|
||||
13
Task/Loops-Do-while/OCaml/loops-do-while-4.ocaml
Normal file
13
Task/Loops-Do-while/OCaml/loops-do-while-4.ocaml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
let do_while f p ~init =
|
||||
let rec loop v =
|
||||
let v = f v in
|
||||
if p v then loop v
|
||||
in
|
||||
loop init
|
||||
|
||||
do_while (fun v ->
|
||||
let v = succ v in
|
||||
Printf.printf "%d\n" v;
|
||||
(v))
|
||||
(fun v -> v mod 6 <> 0)
|
||||
~init:0
|
||||
9
Task/Loops-Do-while/OCaml/loops-do-while-5.ocaml
Normal file
9
Task/Loops-Do-while/OCaml/loops-do-while-5.ocaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
let v = ref 0
|
||||
exception Exit_loop
|
||||
try while true do
|
||||
incr v;
|
||||
Printf.printf "%d\n" !v;
|
||||
if not(!v mod 6 <> 0) then
|
||||
raise Exit_loop;
|
||||
done
|
||||
with Exit_loop -> ()
|
||||
6
Task/Loops-Do-while/Objeck/loops-do-while.objeck
Normal file
6
Task/Loops-Do-while/Objeck/loops-do-while.objeck
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
i := 0;
|
||||
do {
|
||||
i += 1;
|
||||
i->PrintLine();
|
||||
}
|
||||
while (i % 6 <> 0);
|
||||
5
Task/Loops-Do-while/Octave/loops-do-while.octave
Normal file
5
Task/Loops-Do-while/Octave/loops-do-while.octave
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
val = 0;
|
||||
do
|
||||
val++;
|
||||
disp(val)
|
||||
until( mod(val, 6) == 0 )
|
||||
7
Task/Loops-Do-while/Oz/loops-do-while.oz
Normal file
7
Task/Loops-Do-while/Oz/loops-do-while.oz
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
I = {NewCell 0}
|
||||
in
|
||||
for until:@I mod 6 == 0 do
|
||||
I := @I + 1
|
||||
{Show @I}
|
||||
end
|
||||
5
Task/Loops-Do-while/PARI-GP/loops-do-while.pari
Normal file
5
Task/Loops-Do-while/PARI-GP/loops-do-while.pari
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
x = 0;
|
||||
while(1,
|
||||
print(x++);
|
||||
if(val % 6 == 0, break)
|
||||
)
|
||||
9
Task/Loops-Do-while/PL-I/loops-do-while-1.pli
Normal file
9
Task/Loops-Do-while/PL-I/loops-do-while-1.pli
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
dcl value fixed bin (31) init (0);
|
||||
do forever;
|
||||
value = value + 1;
|
||||
|
||||
if mod(value, 6) = 0 then
|
||||
leave;
|
||||
|
||||
put list (value);
|
||||
end;
|
||||
5
Task/Loops-Do-while/PL-I/loops-do-while-2.pli
Normal file
5
Task/Loops-Do-while/PL-I/loops-do-while-2.pli
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
dcl value fixed bin(31) init(0);
|
||||
do Until(value=6);
|
||||
value+=1;
|
||||
put Skip list(value);
|
||||
end;
|
||||
12
Task/Loops-Do-while/Pascal/loops-do-while.pascal
Normal file
12
Task/Loops-Do-while/Pascal/loops-do-while.pascal
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
program countto6(output);
|
||||
|
||||
var
|
||||
i: integer;
|
||||
|
||||
begin
|
||||
i := 0;
|
||||
repeat
|
||||
i := i + 1;
|
||||
writeln(i)
|
||||
until i mod 6 = 0
|
||||
end.
|
||||
4
Task/Loops-Do-while/Perl-6/loops-do-while-1.pl6
Normal file
4
Task/Loops-Do-while/Perl-6/loops-do-while-1.pl6
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
my $val = 0;
|
||||
repeat {
|
||||
say ++$val;
|
||||
} while $val % 6;
|
||||
4
Task/Loops-Do-while/Perl-6/loops-do-while-2.pl6
Normal file
4
Task/Loops-Do-while/Perl-6/loops-do-while-2.pl6
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
my $val = 0;
|
||||
repeat {
|
||||
say ++$val;
|
||||
} until $val %% 6;
|
||||
4
Task/Loops-Do-while/Perl-6/loops-do-while-3.pl6
Normal file
4
Task/Loops-Do-while/Perl-6/loops-do-while-3.pl6
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
my $val = 0;
|
||||
repeat while $val % 6 {
|
||||
say ++$val;
|
||||
}
|
||||
7
Task/Loops-Do-while/Pike/loops-do-while.pike
Normal file
7
Task/Loops-Do-while/Pike/loops-do-while.pike
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
int main(){
|
||||
int value = 0;
|
||||
do {
|
||||
value++;
|
||||
write(value + "\n");
|
||||
} while (value % 6);
|
||||
}
|
||||
6
Task/Loops-Do-while/Pop11/loops-do-while.pop11
Normal file
6
Task/Loops-Do-while/Pop11/loops-do-while.pop11
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
lvars val = 0;
|
||||
while true do
|
||||
val + 1 -> val;
|
||||
printf(val, '%p\n');
|
||||
quitif(val rem 6 = 0);
|
||||
endwhile;
|
||||
5
Task/Loops-Do-while/PowerShell/loops-do-while.psh
Normal file
5
Task/Loops-Do-while/PowerShell/loops-do-while.psh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
$n = 0
|
||||
do {
|
||||
$n++
|
||||
$n
|
||||
} while ($n % 6 -ne 0)
|
||||
5
Task/Loops-Do-while/PureBasic/loops-do-while.purebasic
Normal file
5
Task/Loops-Do-while/PureBasic/loops-do-while.purebasic
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
x=0
|
||||
Repeat
|
||||
x+1
|
||||
Debug x
|
||||
Until x%6=0
|
||||
17
Task/Loops-Do-while/REBOL/loops-do-while.rebol
Normal file
17
Task/Loops-Do-while/REBOL/loops-do-while.rebol
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
REBOL [
|
||||
Title: "Loop/While"
|
||||
Author: oofoe
|
||||
Date: 2009-12-19
|
||||
URL: http://rosettacode.org/wiki/Loop/Do_While
|
||||
]
|
||||
|
||||
; REBOL doesn't have a specific 'do/while' construct, but 'until' can
|
||||
; be used to provide the same effect.
|
||||
|
||||
value: 0
|
||||
until [
|
||||
value: value + 1
|
||||
print value
|
||||
|
||||
0 = mod value 6
|
||||
]
|
||||
8
Task/Loops-Do-while/SAS/loops-do-while.sas
Normal file
8
Task/Loops-Do-while/SAS/loops-do-while.sas
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/* using DO UNTIL so that the loop executes at least once */
|
||||
data _null_;
|
||||
n=0;
|
||||
do until(mod(n,6)=0);
|
||||
n=n+1;
|
||||
put n;
|
||||
end;
|
||||
run;
|
||||
7
Task/Loops-Do-while/Salmon/loops-do-while.salmon
Normal file
7
Task/Loops-Do-while/Salmon/loops-do-while.salmon
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
variable x := 0;
|
||||
do
|
||||
{
|
||||
++x;
|
||||
x!
|
||||
}
|
||||
while (x % 6 != 0);
|
||||
11
Task/Loops-Do-while/Seed7/loops-do-while.seed7
Normal file
11
Task/Loops-Do-while/Seed7/loops-do-while.seed7
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
$ include "seed7_05.s7i";
|
||||
|
||||
const proc: main is func
|
||||
local
|
||||
var integer: number is 0;
|
||||
begin
|
||||
repeat
|
||||
incr(number);
|
||||
writeln(number)
|
||||
until number rem 6 = 0
|
||||
end func;
|
||||
6
Task/Loops-Do-while/Slate/loops-do-while.slate
Normal file
6
Task/Loops-Do-while/Slate/loops-do-while.slate
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[| val |
|
||||
val: 0.
|
||||
[val: val + 1.
|
||||
print: val.
|
||||
val \\ 6 ~= 0] whileTrue
|
||||
] do.
|
||||
5
Task/Loops-Do-while/Suneido/loops-do-while-1.suneido
Normal file
5
Task/Loops-Do-while/Suneido/loops-do-while-1.suneido
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
val = 0
|
||||
do
|
||||
{
|
||||
Print(++val)
|
||||
} while (val % 6 isnt 0)
|
||||
6
Task/Loops-Do-while/Suneido/loops-do-while-2.suneido
Normal file
6
Task/Loops-Do-while/Suneido/loops-do-while-2.suneido
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
Task/Loops-Do-while/TUSCRIPT/loops-do-while.tuscript
Normal file
7
Task/Loops-Do-while/TUSCRIPT/loops-do-while.tuscript
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
$$ MODE TUSCRIPT
|
||||
var=0
|
||||
LOOP
|
||||
var=var+1, rest=var%6
|
||||
PRINT var
|
||||
IF (rest==0) EXIT
|
||||
ENDLOOP
|
||||
5
Task/Loops-Do-while/UNIX-Shell/loops-do-while-1.sh
Normal file
5
Task/Loops-Do-while/UNIX-Shell/loops-do-while-1.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
val=0
|
||||
while true; do
|
||||
echo $((++val))
|
||||
[ $((val%6)) -eq 0 ] && break
|
||||
done
|
||||
6
Task/Loops-Do-while/UNIX-Shell/loops-do-while-2.sh
Normal file
6
Task/Loops-Do-while/UNIX-Shell/loops-do-while-2.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
val=0
|
||||
while true; do
|
||||
val=`expr $val + 1`
|
||||
echo $val
|
||||
expr $val % 6 = 0 >/dev/null && break
|
||||
done
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#1 = 0
|
||||
do {
|
||||
#1++
|
||||
Num_Type(#1)
|
||||
} while (#1 % 6 != 0);
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Dim i = 0
|
||||
Do
|
||||
i += 1
|
||||
Console.WriteLine(i)
|
||||
Loop Until i Mod 6 = 0
|
||||
7
Task/Loops-Do-while/XPL0/loops-do-while.xpl0
Normal file
7
Task/Loops-Do-while/XPL0/loops-do-while.xpl0
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
code CrLf=9, IntOut=11;
|
||||
int V;
|
||||
[V:= 0;
|
||||
repeat V:= V+1;
|
||||
IntOut(0, V); CrLf(0);
|
||||
until rem(V/6) = 0;
|
||||
]
|
||||
5
Task/Loops-Do-while/Yorick/loops-do-while.yorick
Normal file
5
Task/Loops-Do-while/Yorick/loops-do-while.yorick
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
val = 0;
|
||||
do {
|
||||
val++;
|
||||
write, val;
|
||||
} while(val % 6 != 0);
|
||||
Loading…
Add table
Add a link
Reference in a new issue