Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,6 @@
for I in 1..5 loop
for J in 1..I loop
Put("*");
end loop;
New_Line;
end loop;

View file

@ -0,0 +1,21 @@
IDENTIFICATION DIVISION.
PROGRAM-ID. Display-Triangle.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 Outer-Counter PIC 9.
01 Inner-Counter PIC 9.
PROCEDURE DIVISION.
PERFORM VARYING Outer-Counter FROM 1 BY 1 UNTIL 5 < Outer-Counter
PERFORM VARYING Inner-Counter FROM 1 BY 1
UNTIL Outer-Counter < Inner-Counter
DISPLAY "*" NO ADVANCING
END-PERFORM
DISPLAY "" *> Output a newline
END-PERFORM
GOBACK
.

View file

@ -0,0 +1,4 @@
for i in 1..5 {
for 1..i do write('*');
writeln();
}

View file

@ -0,0 +1,11 @@
;; Lisp implementation of c-for is like:
;; (let ((i nil))
;; (while (progn (setq i (if (not i) 0 (1+ i) )) ;; if value of i is nil, initialize its value to 0, if else, add 1
;; (< i 10)) ;; end loop when i > 10
;; (... body ...) ) ) ;; loop body
(let ((i nil) (str ""))
(while (progn (setq i (if (not i) 0 (1+ i) ))
(< i 5))
(setq str (concat str "*"))
(message str) ) )

View file

@ -0,0 +1,6 @@
for i = 1 to 5 do
for j = 1 to i do
puts(1, "*") -- Same as "puts(1, {'*'})"
end for
puts(1, "\n") -- Same as "puts(1, {'\n'})"
end for

View file

@ -0,0 +1,6 @@
for (i in 1...6) {
for(j in 0...i) {
Sys.print('*');
}
Sys.println('');
}

View file

@ -0,0 +1,6 @@
for (int i = 0; i < 5; i++) {
for (int j = 0; j <= i; j++) {
print '*'
}
println
}

View file

@ -0,0 +1,2 @@
5.map{ it + 1 }
.each{ it.each{ print '*' }; println }

View file

@ -0,0 +1 @@
5.each{ println '*' * (it + 1) }

View file

@ -0,0 +1,10 @@
HAI 1.3
IM IN YR LOOP UPPIN YR I TIL BOTH SAEM I AN 5
IM IN YR LOOP UPPIN YR J TIL BOTH SAEM SUM OF I AN 1 AN J
VISIBLE "*"!
IM OUTTA YR LOOP
VISIBLE ""
IM OUTTA YR LOOP
KTHXBYE

View file

@ -0,0 +1,6 @@
for ($i = 1; $i -le 5; $i++) {
for ($j = 1; $j -le $i; $j++) {
Write-Host -NoNewline *
}
Write-Host
}

View file

@ -0,0 +1,6 @@
1..5 | ForEach-Object {
1..$_ | ForEach-Object {
Write-Host -NoNewline *
}
Write-Host
}

View file

@ -0,0 +1,76 @@
# riscv assembly raspberry pico2 rp2350
# program loop1.s
# connexion putty com3
/*********************************************/
/* CONSTANTES */
/********************************************/
/* for this file see risc-v task include a file */
.include "../../constantesRiscv.inc"
/****************************************************/
/* MACROS */
/****************************************************/
#.include "../ficmacrosriscv.inc" # for debugging only
/*******************************************/
/* INITIALED DATAS */
/*******************************************/
.data
szMessStart: .asciz "Program riscv start.\r\n"
szMessEnd: .asciz "\nProgram end OK.\r\n"
szCariageReturn: .asciz "\r\n"
szMessX: .asciz "X"
.align 2
/*******************************************/
/* UNINITIALED DATA */
/*******************************************/
.bss
.align 2
sConvArea: .skip 24
/********************************...-..--*****/
/* SECTION CODE */
/**********************************************/
.text
.global main
main:
call stdio_init_all # général init
1: # start loop connexion
li a0,0 # raz argument register
call tud_cdc_n_connected # waiting for USB connection
beqz a0,1b # return code = zero ?
la a0,szMessStart # message address
call writeString # display message
li s0,0 # counter loop 1
li s2,5 # maximun
1:
li s1,0 # counter loop 2
2:
la a0,szMessX
call writeString # display "X"
addi s1,s1,1 # increment indice
ble s1,s0,2b # indice 2 <= indice 1 -> loop 2
la a0,szCariageReturn # else dispay CariageReturn
call writeString
addi s0,s0,1 # increment indice 1
blt s0,s2,1b # maxi ? no -> loop 1
la a0,szMessEnd
call writeString
call getchar
100: # final loop
j 100b
/************************************/
/* file include Fonctions */
/***********************************/
/* for this file see risc-v task include a file */
.include "../../includeFunctions.s"

View file

@ -0,0 +1,8 @@
let s = ref("")
for i in 1 to 5 {
for _ in 1 to i {
s := Js.String2.concat(s.contents, "*")
}
s := Js.String2.concat(s.contents, "\n")
}
Js.log(s.contents)

View 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 ""
]

View file

@ -0,0 +1,23 @@
Section FOR.
Variable T : Type.
Variable body : nat -> T -> T.
Variable start : nat.
Fixpoint for_loop n : T -> T :=
match n with
| O => fun s => s
| S n' => fun s => for_loop n' (body (start + n') s)
end.
End FOR.
Eval vm_compute in
for_loop _
(fun i =>
cons
(for_loop _
(fun j => cons tt)
0 (S i) nil
)
)
0 5 nil.

View file

@ -0,0 +1,4 @@
loop 5 {
.inc .loop { prn "*" }
prn newline
}

View file

@ -0,0 +1,11 @@
i = 5
def : lbl
:outer
j = 6 - i
:inner
print *
j - 1
if j inner
printLine
i - 1
if i outer

View file

@ -0,0 +1,8 @@
let write = process.stdout.write
for i in range(5) {
for j in range(i + 1) {
write("*")
}
write("\n")
}

View file

@ -0,0 +1,9 @@
Option Explicit
Dim i, j, s
For i = 1 To 5
s = ""
For j = 1 To i
s = s + "*"
Next
WScript.Echo s
Next