langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
8
Task/Loops-For/Nemerle/loops-for.nemerle
Normal file
8
Task/Loops-For/Nemerle/loops-for.nemerle
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
for (int j = 0; j <= i; j++)
|
||||
{
|
||||
Write("*");
|
||||
}
|
||||
WriteLine();
|
||||
}
|
||||
12
Task/Loops-For/NetRexx/loops-for.netrexx
Normal file
12
Task/Loops-For/NetRexx/loops-for.netrexx
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref savelog symbols nobinary
|
||||
|
||||
say
|
||||
say 'Loops/For'
|
||||
|
||||
loop i_ = 1 to 5
|
||||
loop for i_
|
||||
say '*\-'
|
||||
end
|
||||
say
|
||||
end i_
|
||||
4
Task/Loops-For/NewLISP/loops-for.newlisp
Normal file
4
Task/Loops-For/NewLISP/loops-for.newlisp
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(for (i 1 5)
|
||||
(for(j 1 i)
|
||||
(print "*"))
|
||||
(print "\n"))
|
||||
4
Task/Loops-For/Nimrod/loops-for.nimrod
Normal file
4
Task/Loops-For/Nimrod/loops-for.nimrod
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
for i in 1..5:
|
||||
for i in 1..i:
|
||||
stdout.write("*")
|
||||
echo("")
|
||||
6
Task/Loops-For/OCaml/loops-for.ocaml
Normal file
6
Task/Loops-For/OCaml/loops-for.ocaml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for i = 1 to 5 do
|
||||
for j = 1 to i do
|
||||
print_string "*"
|
||||
done;
|
||||
print_newline ()
|
||||
done
|
||||
16
Task/Loops-For/Objeck/loops-for.objeck
Normal file
16
Task/Loops-For/Objeck/loops-for.objeck
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
bundle Default {
|
||||
class For {
|
||||
function : Main(args : String[]) ~ Nil {
|
||||
DoFor();
|
||||
}
|
||||
|
||||
function : native : DoFor() ~ Nil {
|
||||
for (i := 0; i < 5; i += 1;) {
|
||||
for (j := 0; j <= i; j += 1;) {
|
||||
"*"->Print();
|
||||
};
|
||||
""->PrintLine();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
6
Task/Loops-For/Octave/loops-for.octave
Normal file
6
Task/Loops-For/Octave/loops-for.octave
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for i = 0:1:4
|
||||
for j = 0:1:i
|
||||
printf("*");
|
||||
endfor
|
||||
printf("\n");
|
||||
endfor
|
||||
10
Task/Loops-For/Order/loops-for.order
Normal file
10
Task/Loops-For/Order/loops-for.order
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#include <order/interpreter.h>
|
||||
|
||||
ORDER_PP(
|
||||
8for_each_in_range(8fn(8I,
|
||||
8print(
|
||||
8for_each_in_range(8fn(8J, 8print((*))),
|
||||
1, 8plus(8I, 1))
|
||||
8space)),
|
||||
1, 6)
|
||||
)
|
||||
6
Task/Loops-For/Oz/loops-for.oz
Normal file
6
Task/Loops-For/Oz/loops-for.oz
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for I in 1..5 do
|
||||
for _ in 1..I do
|
||||
{System.printInfo "*"}
|
||||
end
|
||||
{System.showInfo ""}
|
||||
end
|
||||
1
Task/Loops-For/PARI-GP/loops-for.pari
Normal file
1
Task/Loops-For/PARI-GP/loops-for.pari
Normal file
|
|
@ -0,0 +1 @@
|
|||
for(a=1,5,for(b=1,a,print1("*"));print())
|
||||
3
Task/Loops-For/PL-I/loops-for.pli
Normal file
3
Task/Loops-For/PL-I/loops-for.pli
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
do i = 1 to 5;
|
||||
put skip edit (('*' do j = 1 to i)) (a);
|
||||
end;
|
||||
13
Task/Loops-For/Pascal/loops-for.pascal
Normal file
13
Task/Loops-For/Pascal/loops-for.pascal
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
program stars(output);
|
||||
|
||||
var
|
||||
i, j: integer;
|
||||
|
||||
begin
|
||||
for i := 1 to 5 do
|
||||
begin
|
||||
for j := 1 to i do
|
||||
write('*');
|
||||
writeln
|
||||
end
|
||||
end.
|
||||
9
Task/Loops-For/Perl-6/loops-for-1.pl6
Normal file
9
Task/Loops-For/Perl-6/loops-for-1.pl6
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
for ^5 {
|
||||
|
||||
for 0..$_ {
|
||||
print "*";
|
||||
}
|
||||
|
||||
print "\n";
|
||||
|
||||
}
|
||||
1
Task/Loops-For/Perl-6/loops-for-2.pl6
Normal file
1
Task/Loops-For/Perl-6/loops-for-2.pl6
Normal file
|
|
@ -0,0 +1 @@
|
|||
say '*' x $_ for 1..5;
|
||||
1
Task/Loops-For/Perl-6/loops-for-3.pl6
Normal file
1
Task/Loops-For/Perl-6/loops-for-3.pl6
Normal file
|
|
@ -0,0 +1 @@
|
|||
([\~] "*" xx 5).join("\n").say;
|
||||
8
Task/Loops-For/Pike/loops-for.pike
Normal file
8
Task/Loops-For/Pike/loops-for.pike
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
int main(){
|
||||
for(int i = 1; i <= 5; i++){
|
||||
for(int j=1; j <= i; j++){
|
||||
write("*");
|
||||
}
|
||||
write("\n");
|
||||
}
|
||||
}
|
||||
7
Task/Loops-For/Pop11/loops-for.pop11
Normal file
7
Task/Loops-For/Pop11/loops-for.pop11
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
lvars i, j;
|
||||
for i from 1 to 5 do
|
||||
for j from 1 to i do
|
||||
printf('*','%p');
|
||||
endfor;
|
||||
printf('\n')
|
||||
endfor;
|
||||
6
Task/Loops-For/PowerShell/loops-for-1.psh
Normal file
6
Task/Loops-For/PowerShell/loops-for-1.psh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for ($i = 1; $i -le 5; $i++) {
|
||||
for ($j = 1; $j -le $i; $j++) {
|
||||
Write-Host -NoNewline *
|
||||
}
|
||||
Write-Host
|
||||
}
|
||||
6
Task/Loops-For/PowerShell/loops-for-2.psh
Normal file
6
Task/Loops-For/PowerShell/loops-for-2.psh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
1..5 | ForEach-Object {
|
||||
1..$_ | ForEach-Object {
|
||||
Write-Host -NoNewline *
|
||||
}
|
||||
Write-Host
|
||||
}
|
||||
11
Task/Loops-For/PureBasic/loops-for.purebasic
Normal file
11
Task/Loops-For/PureBasic/loops-for.purebasic
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
If OpenConsole()
|
||||
Define i, j
|
||||
For i=1 To 5
|
||||
For j=1 To i
|
||||
Print("*")
|
||||
Next j
|
||||
PrintN("")
|
||||
Next i
|
||||
Print(#LFCR$+"Press ENTER to quit"): Input()
|
||||
CloseConsole()
|
||||
EndIf
|
||||
13
Task/Loops-For/REBOL/loops-for.rebol
Normal file
13
Task/Loops-For/REBOL/loops-for.rebol
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
; Use 'repeat' when an index required, 'loop' when repetition suffices:
|
||||
|
||||
repeat i 5 [
|
||||
loop i [prin "*"]
|
||||
print ""
|
||||
]
|
||||
|
||||
; or a more traditional for loop:
|
||||
|
||||
for i 1 5 1 [
|
||||
loop i [prin "*"]
|
||||
print ""
|
||||
]
|
||||
1
Task/Loops-For/Retro/loops-for.retro
Normal file
1
Task/Loops-For/Retro/loops-for.retro
Normal file
|
|
@ -0,0 +1 @@
|
|||
6 [ 0; cr [ '* emit ] times ] iter
|
||||
10
Task/Loops-For/SAS/loops-for.sas
Normal file
10
Task/Loops-For/SAS/loops-for.sas
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
data _null_;
|
||||
length a $5;
|
||||
do n=1 to 5;
|
||||
a="*";
|
||||
do i=2 to n;
|
||||
a=trim(a) !! "*";
|
||||
end;
|
||||
put a;
|
||||
end;
|
||||
run;
|
||||
6
Task/Loops-For/SNOBOL4/loops-for-1.sno
Normal file
6
Task/Loops-For/SNOBOL4/loops-for-1.sno
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
ol outer = ?lt(outer,5) outer + 1 :f(end)
|
||||
inner = outer; stars = ""
|
||||
il stars = ?gt(inner,0) stars "*" :f(disp)
|
||||
inner = inner - 1 :(il)
|
||||
disp output = stars; :(ol)
|
||||
end
|
||||
4
Task/Loops-For/SNOBOL4/loops-for-2.sno
Normal file
4
Task/Loops-For/SNOBOL4/loops-for-2.sno
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
outer b = a = ?lt(a,5) a + 1 :f(end)
|
||||
inner t = t ?(b = (gt(b,0) b - 1)) "*" :s(inner)
|
||||
t span("*") . terminal = :(outer)
|
||||
end
|
||||
3
Task/Loops-For/SNOBOL4/loops-for-3.sno
Normal file
3
Task/Loops-For/SNOBOL4/loops-for-3.sno
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
a = "*****";
|
||||
a a len(x = x + 1) . output :s(a)
|
||||
end
|
||||
2
Task/Loops-For/SNOBOL4/loops-for-4.sno
Normal file
2
Task/Loops-For/SNOBOL4/loops-for-4.sno
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
"*****" arb $ output fail
|
||||
end
|
||||
6
Task/Loops-For/Salmon/loops-for-1.salmon
Normal file
6
Task/Loops-For/Salmon/loops-for-1.salmon
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
iterate (x; [0...4])
|
||||
{
|
||||
iterate (y; [0...x])
|
||||
print("*");;
|
||||
print("\n");
|
||||
};
|
||||
6
Task/Loops-For/Salmon/loops-for-2.salmon
Normal file
6
Task/Loops-For/Salmon/loops-for-2.salmon
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for (x; 0; x < 5)
|
||||
{
|
||||
for (y; 0; y <= x)
|
||||
print("*");;
|
||||
print("\n");
|
||||
};
|
||||
6
Task/Loops-For/Seed7/loops-for.seed7
Normal file
6
Task/Loops-For/Seed7/loops-for.seed7
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for I range 1 to 5 do
|
||||
for J range 1 to I do
|
||||
write("*");
|
||||
end for;
|
||||
writeln;
|
||||
end for;
|
||||
1
Task/Loops-For/Slate/loops-for.slate
Normal file
1
Task/Loops-For/Slate/loops-for.slate
Normal file
|
|
@ -0,0 +1 @@
|
|||
1 to: 5 do: [| :n | inform: ($* repeatedTimes: n)].
|
||||
7
Task/Loops-For/Suneido/loops-for.suneido
Normal file
7
Task/Loops-For/Suneido/loops-for.suneido
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
for(i = 0; i < 5; ++i)
|
||||
{
|
||||
str = ''
|
||||
for (j = 0; j <= i; ++j)
|
||||
str $= '*'
|
||||
Print(str)
|
||||
}
|
||||
7
Task/Loops-For/TI-89-BASIC/loops-for.ti-89
Normal file
7
Task/Loops-For/TI-89-BASIC/loops-for.ti-89
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
Local i,j
|
||||
ClrIO
|
||||
For i, 1, 5
|
||||
For j, 1, i
|
||||
Output i*8, j*6, "*"
|
||||
EndFor
|
||||
EndFor
|
||||
6
Task/Loops-For/TUSCRIPT/loops-for.tuscript
Normal file
6
Task/Loops-For/TUSCRIPT/loops-for.tuscript
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
$$ MODE TUSCRIPT
|
||||
m=""
|
||||
LOOP n=1,5
|
||||
m=APPEND (m,"","*")
|
||||
PRINT m
|
||||
ENDLOOP
|
||||
8
Task/Loops-For/TorqueScript/loops-for.torquescript
Normal file
8
Task/Loops-For/TorqueScript/loops-for.torquescript
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
for(%i = 0; %i < 5; %i++)
|
||||
{
|
||||
for(%x = %i; %x < 5; %x++)
|
||||
{
|
||||
%string = %string @ "*";
|
||||
echo(%string);
|
||||
}
|
||||
}
|
||||
15
Task/Loops-For/UNIX-Shell/loops-for-1.sh
Normal file
15
Task/Loops-For/UNIX-Shell/loops-for-1.sh
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
# Using a while control construct to emulate a for loop
|
||||
|
||||
l="1" # Set the counters to one
|
||||
while [ "$l" -le 5 ] # Loop while the counter is less than five
|
||||
do
|
||||
m="1"
|
||||
while [ "$m" -le "$l" ] # Loop while the counter is less than five
|
||||
do
|
||||
printf "*"
|
||||
m=`expr "$m" + 1` # Increment the inner counter
|
||||
done
|
||||
echo
|
||||
l=`expr "$l" + 1` # Increment the outer counter
|
||||
done
|
||||
6
Task/Loops-For/UNIX-Shell/loops-for-2.sh
Normal file
6
Task/Loops-For/UNIX-Shell/loops-for-2.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for i in `jot 5`; do
|
||||
for j in `jot $i`; do
|
||||
printf \*
|
||||
done
|
||||
echo
|
||||
done
|
||||
6
Task/Loops-For/UNIX-Shell/loops-for-3.sh
Normal file
6
Task/Loops-For/UNIX-Shell/loops-for-3.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for (( x=1; $x<=5; x=$x+1 )); do
|
||||
for (( y=1; y<=$x; y=$y+1 )); do
|
||||
echo -n '*'
|
||||
done
|
||||
echo ""
|
||||
done
|
||||
6
Task/Loops-For/UNIX-Shell/loops-for-4.sh
Normal file
6
Task/Loops-For/UNIX-Shell/loops-for-4.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
foreach i (`jot 5`)
|
||||
foreach j (`jot $i`)
|
||||
echo -n \*
|
||||
end
|
||||
echo ""
|
||||
end
|
||||
4
Task/Loops-For/UnixPipes/loops-for.unixpipes
Normal file
4
Task/Loops-For/UnixPipes/loops-for.unixpipes
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
yes \ | cat -n | (while read n ; do
|
||||
[ $n -gt 5 ] && exit 0;
|
||||
yes \* | head -n $n | xargs -n $n echo
|
||||
done)
|
||||
6
Task/Loops-For/Vedit-macro-language/loops-for.vedit
Normal file
6
Task/Loops-For/Vedit-macro-language/loops-for.vedit
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for (#1 = 1; #1 <= 5; #1++) {
|
||||
for (#2 = 1; #2 <= #1; #2++) {
|
||||
Type_Char('*')
|
||||
}
|
||||
Type_Newline
|
||||
}
|
||||
6
Task/Loops-For/Visual-Basic-.NET/loops-for.visual
Normal file
6
Task/Loops-For/Visual-Basic-.NET/loops-for.visual
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
For x As Integer = 0 To 4
|
||||
For y As Integer = 0 To x
|
||||
Console.Write("*")
|
||||
Next
|
||||
Console.WriteLine()
|
||||
Next
|
||||
15
Task/Loops-For/Visual-Basic/loops-for.vb
Normal file
15
Task/Loops-For/Visual-Basic/loops-for.vb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
'This Prints to the Debug-Window!
|
||||
Dim i As Integer
|
||||
Dim ii As Integer
|
||||
Dim x As Integer
|
||||
Dim out As String
|
||||
|
||||
output = ""
|
||||
|
||||
For i = 1 To 5
|
||||
For ii = 1 To i
|
||||
out = out + "*"
|
||||
Next ii
|
||||
Debug.Print (out)
|
||||
out = ""
|
||||
Next i
|
||||
7
Task/Loops-For/XPL0/loops-for.xpl0
Normal file
7
Task/Loops-For/XPL0/loops-for.xpl0
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
code ChOut=8, CrLf=9;
|
||||
int I, J;
|
||||
for I:= 1 to 5 do
|
||||
[for J:= 1 to I do
|
||||
ChOut(0, ^*);
|
||||
CrLf(0);
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue