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

View 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

View 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

View file

@ -0,0 +1,5 @@
loop
Value := Value + 1;
Put (Value);
exit when Value mod 6 = 0;
end loop;

View file

@ -0,0 +1,4 @@
for Value in 0..Integer'Last loop
Put (Value);
exit when Value mod 6 = 0;
end loop;

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

View file

@ -0,0 +1,5 @@
var val = 0;
do {
val += 1;
writeln(val);
} while val % 6 > 0;

View file

@ -0,0 +1,6 @@
n = 0
loop do
n += 1
puts n
break if n % 6 == 0
end

View file

@ -0,0 +1,5 @@
(let ((val 0))
(while (progn
(setq val (1+ val))
(message "%d" val)
(/= 0 (mod val 6)))))

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

View 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

View file

@ -0,0 +1,6 @@
var val = 0;
do {
val++;
Sys.println(val);
} while( val % 6 != 0);

View file

@ -0,0 +1,5 @@
int i = 0
do{
i++
println i
} until (i % 6 == 0)

View 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

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

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

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

View file

@ -0,0 +1,5 @@
$n = 0
do {
$n++
$n
} while ($n % 6 -ne 0)

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

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

View file

@ -0,0 +1,4 @@
n:: 0
until { n .is-multiple-of 6 } {
print inc! 'n
}

View file

@ -0,0 +1,5 @@
lblloop
i + 1
printInt i
x = i % 6
if x loop

View file

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

View file

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