Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
6
Task/Loops-For/Ada/loops-for.adb
Normal file
6
Task/Loops-For/Ada/loops-for.adb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for I in 1..5 loop
|
||||
for J in 1..I loop
|
||||
Put("*");
|
||||
end loop;
|
||||
New_Line;
|
||||
end loop;
|
||||
21
Task/Loops-For/COBOL/loops-for.cob
Normal file
21
Task/Loops-For/COBOL/loops-for.cob
Normal 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
|
||||
.
|
||||
4
Task/Loops-For/Chapel/loops-for.chpl
Normal file
4
Task/Loops-For/Chapel/loops-for.chpl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
for i in 1..5 {
|
||||
for 1..i do write('*');
|
||||
writeln();
|
||||
}
|
||||
11
Task/Loops-For/Emacs-Lisp/loops-for.el
Normal file
11
Task/Loops-For/Emacs-Lisp/loops-for.el
Normal 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) ) )
|
||||
6
Task/Loops-For/Euphoria/loops-for.eu
Normal file
6
Task/Loops-For/Euphoria/loops-for.eu
Normal 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
|
||||
6
Task/Loops-For/Haxe/loops-for.hx
Normal file
6
Task/Loops-For/Haxe/loops-for.hx
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for (i in 1...6) {
|
||||
for(j in 0...i) {
|
||||
Sys.print('*');
|
||||
}
|
||||
Sys.println('');
|
||||
}
|
||||
6
Task/Loops-For/Jactl/loops-for-1.jactl
Normal file
6
Task/Loops-For/Jactl/loops-for-1.jactl
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for (int i = 0; i < 5; i++) {
|
||||
for (int j = 0; j <= i; j++) {
|
||||
print '*'
|
||||
}
|
||||
println
|
||||
}
|
||||
2
Task/Loops-For/Jactl/loops-for-2.jactl
Normal file
2
Task/Loops-For/Jactl/loops-for-2.jactl
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
5.map{ it + 1 }
|
||||
.each{ it.each{ print '*' }; println }
|
||||
1
Task/Loops-For/Jactl/loops-for-3.jactl
Normal file
1
Task/Loops-For/Jactl/loops-for-3.jactl
Normal file
|
|
@ -0,0 +1 @@
|
|||
5.each{ println '*' * (it + 1) }
|
||||
10
Task/Loops-For/LOLCODE/loops-for.lol
Normal file
10
Task/Loops-For/LOLCODE/loops-for.lol
Normal 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
|
||||
6
Task/Loops-For/PowerShell/loops-for-1.ps1
Normal file
6
Task/Loops-For/PowerShell/loops-for-1.ps1
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.ps1
Normal file
6
Task/Loops-For/PowerShell/loops-for-2.ps1
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
1..5 | ForEach-Object {
|
||||
1..$_ | ForEach-Object {
|
||||
Write-Host -NoNewline *
|
||||
}
|
||||
Write-Host
|
||||
}
|
||||
76
Task/Loops-For/RISC-V-Assembly/loops-for.asm
Normal file
76
Task/Loops-For/RISC-V-Assembly/loops-for.asm
Normal 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"
|
||||
8
Task/Loops-For/ReScript/loops-for.res
Normal file
8
Task/Loops-For/ReScript/loops-for.res
Normal 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)
|
||||
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 ""
|
||||
]
|
||||
23
Task/Loops-For/Rocq/loops-for.rocq
Normal file
23
Task/Loops-For/Rocq/loops-for.rocq
Normal 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.
|
||||
4
Task/Loops-For/Rye/loops-for.rye
Normal file
4
Task/Loops-For/Rye/loops-for.rye
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
loop 5 {
|
||||
.inc .loop { prn "*" }
|
||||
prn newline
|
||||
}
|
||||
11
Task/Loops-For/SIL/loops-for.sil
Normal file
11
Task/Loops-For/SIL/loops-for.sil
Normal 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
|
||||
8
Task/Loops-For/Ursalang/loops-for.ursa
Normal file
8
Task/Loops-For/Ursalang/loops-for.ursa
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
let write = process.stdout.write
|
||||
|
||||
for i in range(5) {
|
||||
for j in range(i + 1) {
|
||||
write("*")
|
||||
}
|
||||
write("\n")
|
||||
}
|
||||
9
Task/Loops-For/VBScript/loops-for.vbs
Normal file
9
Task/Loops-For/VBScript/loops-for.vbs
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue