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

@ -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

View 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

View file

@ -0,0 +1,6 @@
for i to 5 do
for j to i do
write( "*" )
od;
print()
od

View file

@ -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

View file

@ -1,7 +0,0 @@
"
*
**
***
****
*****
"

View file

@ -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

View file

@ -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

View file

@ -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

View 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

View file

@ -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

View file

@ -1,6 +0,0 @@
FOR I% = 1 TO 5
FOR J% = 1 TO I%
PRINT"*";
NEXT
PRINT
NEXT

View file

@ -0,0 +1,6 @@
for (i = 1; i <= 5; i++) {
for (j = 1; j <= i; j++) "*"
"
"
}
quit

View 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

View 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()

View file

@ -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
].
].

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,6 @@
U8 i, j;
for (i = 1; i <= 5; i++) {
for (j = 1; j <= i; j++)
Print("*");
Print("\n");
}

View file

@ -1,6 +0,0 @@
for i = 1 to 5
for j = 1 to i
print "*";
next
print
next

View 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

View file

@ -1,4 +1,4 @@
for i in 1..5:
for i in 1..i:
for j in 1..i:
stdout.write("*")
echo("")

View file

@ -1,4 +0,0 @@
for i in 1..5:
for i in 1..i:
stdout.write("*")
echo("")

View 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:

View 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 );

View file

@ -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

View file

@ -1,6 +0,0 @@
FOR i = 1 TO 5
FOR j = 1 TO i
PRINT "*";
NEXT j
PRINT
NEXT i

View file

@ -0,0 +1,6 @@
> i, 1..5
> j, 1..i
#.output("*",#.rs)
<
#.output()
<

View file

@ -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

View file

@ -0,0 +1,7 @@
forvalues n=1/5 {
local s ""
forvalues i=1/`n' {
local s `s'*
}
display "`s'"
}

View file

@ -1,6 +0,0 @@
ClrHome
For(I,1,5)
For(J,1,I)
Output(I,J,"*")
End
End

View file

@ -0,0 +1,6 @@
: PRINTSTARS ( ROWS -- )
1 + 1 DO
I 0 DO
PRINT " * " LOOP
CR LOOP ;
5 PRINTSTARS

View file

@ -1,6 +0,0 @@
For x As Integer = 0 To 4
For y As Integer = 0 To x
Console.Write("*")
Next
Console.WriteLine()
Next

View file

@ -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

View 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

View file

@ -0,0 +1,4 @@
foreach i in ([1..5]){
foreach j in (i){print("*")}
println();
}