September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,4 +1,7 @@
|
|||
FOR i:=1 UNTIL 5 DO
|
||||
FOR j:=1 UNTIL i DO
|
||||
INTEGER I,J;
|
||||
FOR I:=1 STEP 1 UNTIL 5 DO
|
||||
BEGIN
|
||||
FOR J:=1 STEP 1 UNTIL I DO
|
||||
OUTTEXT("*");
|
||||
OUTLINE
|
||||
END
|
||||
|
|
|
|||
9
Task/Loops-For/ALGOL-M/loops-for.algol-m
Normal file
9
Task/Loops-For/ALGOL-M/loops-for.algol-m
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
BEGIN
|
||||
INTEGER I, J;
|
||||
FOR I := 1 STEP 1 UNTIL 5 DO
|
||||
BEGIN
|
||||
WRITE( "" );
|
||||
FOR J := 1 STEP 1 UNTIL I DO
|
||||
WRITEON( "*" );
|
||||
END;
|
||||
END
|
||||
6
Task/Loops-For/Agena/loops-for.agena
Normal file
6
Task/Loops-For/Agena/loops-for.agena
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for i to 5 do
|
||||
for j to i do
|
||||
write( "*" )
|
||||
od;
|
||||
print()
|
||||
od
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
set x to return
|
||||
repeat with i from 1 to 5
|
||||
repeat with j from 1 to i
|
||||
set x to x & "*"
|
||||
end repeat
|
||||
set x to x & return
|
||||
end repeat
|
||||
return x
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
"
|
||||
*
|
||||
**
|
||||
***
|
||||
****
|
||||
*****
|
||||
"
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
Public OutConsole As Scripting.TextStream
|
||||
For i = 0 To 4
|
||||
For j = 0 To i
|
||||
OutConsole.Write "*"
|
||||
Next j
|
||||
OutConsole.WriteLine
|
||||
Next i
|
||||
for n = 1 to 5
|
||||
for m = 1 to n
|
||||
print "*";
|
||||
next m
|
||||
print
|
||||
next n
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
For x As Integer = 0 To 4
|
||||
For y As Integer = 0 To x
|
||||
Console.Write("*")
|
||||
Next
|
||||
Console.WriteLine()
|
||||
Next
|
||||
Public OutConsole As Scripting.TextStream
|
||||
For i = 0 To 4
|
||||
For j = 0 To i
|
||||
OutConsole.Write "*"
|
||||
Next j
|
||||
OutConsole.WriteLine
|
||||
Next i
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
10 FOR i = 1 TO 5
|
||||
20 FOR j = 1 TO i
|
||||
30 PRINT "*";
|
||||
40 NEXT j
|
||||
50 PRINT
|
||||
60 NEXT i
|
||||
For x As Integer = 0 To 4
|
||||
For y As Integer = 0 To x
|
||||
Console.Write("*")
|
||||
Next
|
||||
Console.WriteLine()
|
||||
Next
|
||||
|
|
|
|||
6
Task/Loops-For/BASIC/loops-for-15.basic
Normal file
6
Task/Loops-For/BASIC/loops-for-15.basic
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
10 FOR i = 1 TO 5
|
||||
20 FOR j = 1 TO i
|
||||
30 PRINT "*";
|
||||
40 NEXT j
|
||||
50 PRINT
|
||||
60 NEXT i
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
10 FOR I = 1 TO 5
|
||||
20 FOR J = 1 TO I
|
||||
30 PRINT "*";
|
||||
40 NEXT J
|
||||
40 NEXT
|
||||
50 PRINT
|
||||
60 NEXT I
|
||||
60 NEXT
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
FOR I% = 1 TO 5
|
||||
FOR J% = 1 TO I%
|
||||
PRINT"*";
|
||||
NEXT
|
||||
PRINT
|
||||
NEXT
|
||||
6
Task/Loops-For/Bc/loops-for.bc
Normal file
6
Task/Loops-For/Bc/loops-for.bc
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for (i = 1; i <= 5; i++) {
|
||||
for (j = 1; j <= i; j++) "*"
|
||||
"
|
||||
"
|
||||
}
|
||||
quit
|
||||
15
Task/Loops-For/Dc/loops-for.dc
Normal file
15
Task/Loops-For/Dc/loops-for.dc
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
[
|
||||
[*]P [print asterisk]sz
|
||||
lj 1 + d sj [increment j, leave it on stack]sz
|
||||
li !<A [continue loop if i >= j]sz
|
||||
]sA
|
||||
[
|
||||
1 d sj [j = 1, leave it on stack]sz
|
||||
li !<A [enter loop A if i >= j]sz
|
||||
[
|
||||
]P [print newline]sz
|
||||
li 1 + d si [increment i, leave it on stack]sz
|
||||
5 !<B [continue loop if 5 >= i]sz
|
||||
]sB
|
||||
1 d si [i = 1, leave it on stack]sz
|
||||
5 !<B [enter loop B if 5 >= i]sz
|
||||
34
Task/Loops-For/Dodo0/loops-for.dodo0
Normal file
34
Task/Loops-For/Dodo0/loops-for.dodo0
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
fun for -> var, test, body, return # define a for loop using recursion
|
||||
(
|
||||
test(var) -> continue
|
||||
if (continue) ->
|
||||
(
|
||||
body(var) -> var
|
||||
for (var, test, body, return)
|
||||
)
|
||||
|
|
||||
return(var)
|
||||
)
|
||||
| for
|
||||
|
||||
fun upToFive (-> index, return) '<='(index, 5, return) | upToFive
|
||||
|
||||
for (1, upToFive) -> index, return
|
||||
(
|
||||
fun countTheStars -> stars, return
|
||||
(
|
||||
'count'(stars) -> n
|
||||
'<'(n, index, return) # continue until n = index
|
||||
)
|
||||
| countTheStars
|
||||
|
||||
for ("*", countTheStars) -> prefix, return
|
||||
'str'(prefix, "*", return)
|
||||
| stars
|
||||
|
||||
println(stars) ->
|
||||
|
||||
'inc'(index, return)
|
||||
)
|
||||
| result
|
||||
exit()
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
#import system.
|
||||
#import extensions.
|
||||
import extensions.
|
||||
|
||||
#symbol program =
|
||||
program =
|
||||
[
|
||||
0 till:5 &doEach:i
|
||||
0 till:5 do(:i)
|
||||
[
|
||||
0 to:i &doEach:j
|
||||
[ console write:"*". ].
|
||||
0 to:i do(:j)
|
||||
[ console write:"*" ].
|
||||
|
||||
console writeLine.
|
||||
console writeLine
|
||||
].
|
||||
].
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
#APPTYPE CONSOLE
|
||||
FOR dim i = 1 TO 5
|
||||
FOR dim j = 1 TO i
|
||||
PRINT "*";
|
||||
NEXT j
|
||||
PRINT
|
||||
NEXT i
|
||||
Pause
|
||||
|
|
@ -1,6 +1,11 @@
|
|||
for i = 1 to 5
|
||||
for j = 1 to i
|
||||
print "*";
|
||||
next
|
||||
print
|
||||
next
|
||||
Public Sub Main()
|
||||
Dim i, j As Integer
|
||||
|
||||
For i = 1 To 5
|
||||
For j = 1 To i
|
||||
Print "*";
|
||||
Next
|
||||
Print
|
||||
Next
|
||||
|
||||
End
|
||||
|
|
|
|||
6
Task/Loops-For/HolyC/loops-for-1.holyc
Normal file
6
Task/Loops-For/HolyC/loops-for-1.holyc
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
U8 i, j;
|
||||
for (i = 1; i <= 5; i++) {
|
||||
for (j = 1; j <= i; j++)
|
||||
Print("*");
|
||||
Print("\n");
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
for i = 1 to 5
|
||||
for j = 1 to i
|
||||
print "*";
|
||||
next
|
||||
print
|
||||
next
|
||||
26
Task/Loops-For/Make/loops-for.make
Normal file
26
Task/Loops-For/Make/loops-for.make
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
all: line-5
|
||||
|
||||
ILIST != jot 5
|
||||
.for I in $(ILIST)
|
||||
|
||||
line-$(I): asterisk-$(I)-$(I)
|
||||
@echo
|
||||
|
||||
JLIST != jot $(I)
|
||||
. for J in $(JLIST)
|
||||
|
||||
. if "$(J)" == "1"
|
||||
. if "$(I)" == "1"
|
||||
asterisk-1-1:
|
||||
. else
|
||||
IM != expr $(I) - 1
|
||||
asterisk-$(I)-1: line-$(IM)
|
||||
. endif
|
||||
. else
|
||||
JM != expr $(J) - 1
|
||||
asterisk-$(I)-$(J): asterisk-$(I)-$(JM)
|
||||
. endif
|
||||
@printf \*
|
||||
|
||||
. endfor
|
||||
.endfor
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
for i in 1..5:
|
||||
for i in 1..i:
|
||||
for j in 1..i:
|
||||
stdout.write("*")
|
||||
echo("")
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
for i in 1..5:
|
||||
for i in 1..i:
|
||||
stdout.write("*")
|
||||
echo("")
|
||||
12
Task/Loops-For/PILOT/loops-for.pilot
Normal file
12
Task/Loops-For/PILOT/loops-for.pilot
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
C :i = 1
|
||||
*OuterLoop
|
||||
C :j = 0
|
||||
C :$stars =
|
||||
*InnerLoop
|
||||
C :j = j + 1
|
||||
C :$stars =*$stars
|
||||
J ( j < i ) :*InnerLoop
|
||||
T :$stars
|
||||
C :i = i + 1
|
||||
J ( i < 6 ) :*OuterLoop
|
||||
END:
|
||||
5
Task/Loops-For/Processing/loops-for
Normal file
5
Task/Loops-For/Processing/loops-for
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
size( 105,120 );
|
||||
|
||||
for ( int i=20; i<=100; i+=20 )
|
||||
for ( int j=10; j<=i; j+=20 )
|
||||
text( "*", j,i );
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
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
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
FOR i = 1 TO 5
|
||||
FOR j = 1 TO i
|
||||
PRINT "*";
|
||||
NEXT j
|
||||
PRINT
|
||||
NEXT i
|
||||
6
Task/Loops-For/SPL/loops-for.spl
Normal file
6
Task/Loops-For/SPL/loops-for.spl
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
> i, 1..5
|
||||
> j, 1..i
|
||||
#.output("*",#.rs)
|
||||
<
|
||||
#.output()
|
||||
<
|
||||
|
|
@ -1,4 +1,9 @@
|
|||
FOR I:=1 UNTIL 5 DO
|
||||
FOR J:=1 UNTIL I DO
|
||||
OUTTEXT("*");
|
||||
OUTLINE
|
||||
begin
|
||||
integer i,j;
|
||||
for i:=1 step 1 until 5 do
|
||||
begin
|
||||
for j:=1 step 1 until i do
|
||||
outtext("*");
|
||||
outimage
|
||||
end
|
||||
end
|
||||
|
|
|
|||
7
Task/Loops-For/Stata/loops-for.stata
Normal file
7
Task/Loops-For/Stata/loops-for.stata
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
forvalues n=1/5 {
|
||||
local s ""
|
||||
forvalues i=1/`n' {
|
||||
local s `s'*
|
||||
}
|
||||
display "`s'"
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
ClrHome
|
||||
For(I,1,5)
|
||||
For(J,1,I)
|
||||
Output(I,J,"*")
|
||||
End
|
||||
End
|
||||
6
Task/Loops-For/TransFORTH/loops-for.transforth
Normal file
6
Task/Loops-For/TransFORTH/loops-for.transforth
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
: PRINTSTARS ( ROWS -- )
|
||||
1 + 1 DO
|
||||
I 0 DO
|
||||
PRINT " * " LOOP
|
||||
CR LOOP ;
|
||||
5 PRINTSTARS
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
For x As Integer = 0 To 4
|
||||
For y As Integer = 0 To x
|
||||
Console.Write("*")
|
||||
Next
|
||||
Console.WriteLine()
|
||||
Next
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
'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
|
||||
21
Task/Loops-For/X86-Assembly/loops-for.x86
Normal file
21
Task/Loops-For/X86-Assembly/loops-for.x86
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
loops: mov bx, 1 ; outer loop counter
|
||||
|
||||
outerloop: mov cx, bx ; inner loop counter
|
||||
mov dl, 42 ; '*' character
|
||||
|
||||
innerloop: mov ah, 6
|
||||
int 21h ; print
|
||||
|
||||
dec cx
|
||||
jcxz innerdone
|
||||
jmp innerloop
|
||||
|
||||
innerdone: mov dl, 10 ; newline
|
||||
mov ah, 6
|
||||
int 21h
|
||||
|
||||
inc bx
|
||||
cmp bx, 6
|
||||
jne outerloop
|
||||
|
||||
ret
|
||||
4
Task/Loops-For/Zkl/loops-for.zkl
Normal file
4
Task/Loops-For/Zkl/loops-for.zkl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
foreach i in ([1..5]){
|
||||
foreach j in (i){print("*")}
|
||||
println();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue