Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
12
Task/Loops-Do-while/ALGOL-60/loops-do-while-3.alg
Normal file
12
Task/Loops-Do-while/ALGOL-60/loops-do-while-3.alg
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
COMMENT Loops/Do-while;
|
||||
|
||||
BEGIN
|
||||
INTEGER i;
|
||||
i := 0;
|
||||
REPEAT
|
||||
i := i + 1;
|
||||
write(1, i);
|
||||
skip(1)
|
||||
UNTIL i MOD 6 = 0
|
||||
END
|
||||
FINISH
|
||||
7
Task/Loops-Do-while/ANSI-BASIC/loops-do-while-1.basic
Normal file
7
Task/Loops-Do-while/ANSI-BASIC/loops-do-while-1.basic
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
10 REM Loops/Do-while
|
||||
20 LET I = 0
|
||||
30 DO
|
||||
40 LET I = I + 1
|
||||
50 PRINT I
|
||||
60 LOOP WHILE MOD(I, 6) <> 0
|
||||
70 END
|
||||
7
Task/Loops-Do-while/ANSI-BASIC/loops-do-while-2.basic
Normal file
7
Task/Loops-Do-while/ANSI-BASIC/loops-do-while-2.basic
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
10 REM Loops/Do-while
|
||||
20 LET I = 0
|
||||
30 DO
|
||||
40 LET I = I + 1
|
||||
50 PRINT I
|
||||
60 LOOP UNTIL MOD(I, 6) = 0
|
||||
70 END
|
||||
5
Task/Loops-Do-while/Ada/loops-do-while-1.adb
Normal file
5
Task/Loops-Do-while/Ada/loops-do-while-1.adb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
loop
|
||||
Value := Value + 1;
|
||||
Put (Value);
|
||||
exit when Value mod 6 = 0;
|
||||
end loop;
|
||||
4
Task/Loops-Do-while/Ada/loops-do-while-2.adb
Normal file
4
Task/Loops-Do-while/Ada/loops-do-while-2.adb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
for Value in 0..Integer'Last loop
|
||||
Put (Value);
|
||||
exit when Value mod 6 = 0;
|
||||
end loop;
|
||||
15
Task/Loops-Do-while/COBOL/loops-do-while.cob
Normal file
15
Task/Loops-Do-while/COBOL/loops-do-while.cob
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. loop-do-while.
|
||||
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 i PIC 99 VALUE 0.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
PERFORM WITH TEST AFTER UNTIL FUNCTION MOD(i, 6) = 0
|
||||
ADD 1 TO i
|
||||
DISPLAY i
|
||||
END-PERFORM
|
||||
|
||||
GOBACK
|
||||
.
|
||||
5
Task/Loops-Do-while/Chapel/loops-do-while.chpl
Normal file
5
Task/Loops-Do-while/Chapel/loops-do-while.chpl
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
var val = 0;
|
||||
do {
|
||||
val += 1;
|
||||
writeln(val);
|
||||
} while val % 6 > 0;
|
||||
6
Task/Loops-Do-while/Crystal/loops-do-while.cr
Normal file
6
Task/Loops-Do-while/Crystal/loops-do-while.cr
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
n = 0
|
||||
loop do
|
||||
n += 1
|
||||
puts n
|
||||
break if n % 6 == 0
|
||||
end
|
||||
5
Task/Loops-Do-while/Emacs-Lisp/loops-do-while-1.el
Normal file
5
Task/Loops-Do-while/Emacs-Lisp/loops-do-while-1.el
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(let ((val 0))
|
||||
(while (progn
|
||||
(setq val (1+ val))
|
||||
(message "%d" val)
|
||||
(/= 0 (mod val 6)))))
|
||||
5
Task/Loops-Do-while/Emacs-Lisp/loops-do-while-2.el
Normal file
5
Task/Loops-Do-while/Emacs-Lisp/loops-do-while-2.el
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(let ((val 0) done)
|
||||
(while (not done)
|
||||
(setq val (1+ val))
|
||||
(message "%d" val)
|
||||
(setq done (zerop (mod val 6)))))
|
||||
12
Task/Loops-Do-while/Euphoria/loops-do-while.eu
Normal file
12
Task/Loops-Do-while/Euphoria/loops-do-while.eu
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
include std/console.e
|
||||
include std/math.e
|
||||
|
||||
atom x = 0
|
||||
|
||||
loop do
|
||||
x += 1
|
||||
?x
|
||||
until(mod(x,6)) = 0
|
||||
end loop
|
||||
|
||||
if getc(0) then end if
|
||||
6
Task/Loops-Do-while/Haxe/loops-do-while.hx
Normal file
6
Task/Loops-Do-while/Haxe/loops-do-while.hx
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
var val = 0;
|
||||
|
||||
do {
|
||||
val++;
|
||||
Sys.println(val);
|
||||
} while( val % 6 != 0);
|
||||
5
Task/Loops-Do-while/Jactl/loops-do-while.jactl
Normal file
5
Task/Loops-Do-while/Jactl/loops-do-while.jactl
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
int i = 0
|
||||
do{
|
||||
i++
|
||||
println i
|
||||
} until (i % 6 == 0)
|
||||
14
Task/Loops-Do-while/LOLCODE/loops-do-while.lol
Normal file
14
Task/Loops-Do-while/LOLCODE/loops-do-while.lol
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
HAI 1.3
|
||||
|
||||
I HAS A N ITZ A NUMBR
|
||||
|
||||
IM IN YR LOOP
|
||||
N R SUM OF N AN 1
|
||||
VISIBLE N
|
||||
BOTH SAEM 0 AN MOD OF N AN 6, O RLY?
|
||||
YA RLY
|
||||
GTFO
|
||||
OIC
|
||||
IM OUTTA YR LOOP
|
||||
|
||||
KTHXBYE
|
||||
13
Task/Loops-Do-while/Loglan82/loops-do-while.loglan82
Normal file
13
Task/Loops-Do-while/Loglan82/loops-do-while.loglan82
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
(* Loops/Do-while *)
|
||||
|
||||
block
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
i := 0;
|
||||
do
|
||||
i := i + 1;
|
||||
writeln(i);
|
||||
if i mod 6 = 0 then exit fi;
|
||||
od
|
||||
end;
|
||||
14
Task/Loops-Do-while/PL-I/loops-do-while-3.pli
Normal file
14
Task/Loops-Do-while/PL-I/loops-do-while-3.pli
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/* Loops/Do-while */
|
||||
do_while_demo:
|
||||
procedure options(main);
|
||||
declare
|
||||
i fixed binary;
|
||||
i = 0;
|
||||
/* first iteration - before the loop */
|
||||
i = i + 1;
|
||||
put skip list(i);
|
||||
do while (mod(i, 6) ~= 0);
|
||||
i = i + 1;
|
||||
put skip list(i);
|
||||
end;
|
||||
end;
|
||||
14
Task/Loops-Do-while/PL-I/loops-do-while-4.pli
Normal file
14
Task/Loops-Do-while/PL-I/loops-do-while-4.pli
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/* Loops/Do-while */
|
||||
do_while_demo:
|
||||
procedure options(main);
|
||||
declare
|
||||
i fixed binary;
|
||||
i = 0;
|
||||
do while ('1'b);
|
||||
i = i + 1;
|
||||
put skip list(i);
|
||||
if mod(i, 6) = 0 then
|
||||
goto lab_done;
|
||||
end;
|
||||
lab_done:
|
||||
end;
|
||||
5
Task/Loops-Do-while/PowerShell/loops-do-while.ps1
Normal file
5
Task/Loops-Do-while/PowerShell/loops-do-while.ps1
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
$n = 0
|
||||
do {
|
||||
$n++
|
||||
$n
|
||||
} while ($n % 6 -ne 0)
|
||||
70
Task/Loops-Do-while/RISC-V-Assembly/loops-do-while.asm
Normal file
70
Task/Loops-Do-while/RISC-V-Assembly/loops-do-while.asm
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# riscv assembly raspberry pico2 rp2350
|
||||
# program loopwhile.s
|
||||
# connexion putty com3
|
||||
/*********************************************/
|
||||
/* CONSTANTES */
|
||||
/********************************************/
|
||||
/* for this file see risc-v task include a file */
|
||||
.include "../../../constantesRiscv.inc"
|
||||
/*******************************************/
|
||||
/* INITIALED DATAS */
|
||||
/*******************************************/
|
||||
.data
|
||||
szMessStart: .asciz "Program riscv start.\r\n"
|
||||
szMessEndOk: .asciz "Program riscv end OK.\r\n"
|
||||
szCariageReturn: .asciz "\r\n"
|
||||
szMessResult: .asciz "Counter = " # message result
|
||||
|
||||
|
||||
.align 2
|
||||
/*******************************************/
|
||||
/* UNINITIALED DATA */
|
||||
/*******************************************/
|
||||
.bss
|
||||
sConvArea: .skip 24
|
||||
.align 2
|
||||
|
||||
/**********************************************/
|
||||
/* 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 ? yes -> loop
|
||||
|
||||
la a0,szMessStart # message address
|
||||
call writeString # display message
|
||||
|
||||
li s0,0
|
||||
li s1,6
|
||||
1:
|
||||
mv a0,s0
|
||||
la a1,sConvArea # conversion area
|
||||
call conversion10 # conversion décimale
|
||||
|
||||
la a0,szMessResult
|
||||
call writeString # display message
|
||||
la a0,sConvArea
|
||||
call writeString
|
||||
la a0,szCariageReturn
|
||||
call writeString
|
||||
addi s0,s0,1 # increment counter
|
||||
rem t0,s0,s1 # remainder division by 6
|
||||
bnez t0,1b # if remainder not zero -> loop
|
||||
|
||||
la a0,szMessEndOk # message address
|
||||
call writeString # display message
|
||||
call getchar
|
||||
100: # final loop
|
||||
j 100b
|
||||
|
||||
/************************************/
|
||||
/* file include Fonctions */
|
||||
/***********************************/
|
||||
/* for this file see risc-v task include a file */
|
||||
.include "../../../includeFunctions.s"
|
||||
15
Task/Loops-Do-while/Rebol/loops-do-while.rebol
Normal file
15
Task/Loops-Do-while/Rebol/loops-do-while.rebol
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
REBOL [
|
||||
Title: "Loop/While"
|
||||
URL: http://rosettacode.org/wiki/Loop/Do_While
|
||||
]
|
||||
|
||||
; REBOL doesn't have a specific 'do/while' construct, but 'until' can
|
||||
; be used to provide the same effect.
|
||||
|
||||
value: 0
|
||||
until [
|
||||
value: value + 1
|
||||
print value
|
||||
|
||||
0 = mod value 6
|
||||
]
|
||||
4
Task/Loops-Do-while/Rye/loops-do-while.rye
Normal file
4
Task/Loops-Do-while/Rye/loops-do-while.rye
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
n:: 0
|
||||
until { n .is-multiple-of 6 } {
|
||||
print inc! 'n
|
||||
}
|
||||
5
Task/Loops-Do-while/SIL/loops-do-while.sil
Normal file
5
Task/Loops-Do-while/SIL/loops-do-while.sil
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
lblloop
|
||||
i + 1
|
||||
printInt i
|
||||
x = i % 6
|
||||
if x loop
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
fn main() {
|
||||
mut value := 0
|
||||
for {
|
||||
value++
|
||||
println(value)
|
||||
if value%6 != 0 {
|
||||
break
|
||||
}
|
||||
value++
|
||||
println(value)
|
||||
if value%6 == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
fn main() {
|
||||
// do-while loop 1
|
||||
// while loop
|
||||
mut n1 := 2
|
||||
for n1 < 6 {
|
||||
n1 *= 2
|
||||
}
|
||||
println(n1) // prt 8
|
||||
// do-while loop 2
|
||||
|
||||
// do-while loop 1
|
||||
mut n2 := 2
|
||||
for ok := true; ok; ok = n2%8 != 0 {
|
||||
n2 *= 2
|
||||
}
|
||||
println(n2) // prt 8
|
||||
// do-while loop 3
|
||||
|
||||
// do-while loop 2
|
||||
mut n3 := 2
|
||||
for {
|
||||
n3 *= 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue