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,8 @@
declare
I : Integer := 1024;
begin
while I > 0 loop
Put_Line(Integer'Image(I));
I := I / 2;
end loop;
end;

View file

@ -0,0 +1,6 @@
(import std.Math :floor)
(mut n 1024)
(while (> n 0) {
(print n)
(set n (floor (/ n 2))) })

View file

@ -0,0 +1,24 @@
[1024 = 2^3 * 2^3 * 2^4]
++++++++[->++++++++[->++++++++++++++++<]<]>>
[
>[-]>[-]+>[-]+<
[
>[-<-
<<[->+>+<<]
>[-<+>]>>
]
++++++++++>[-]+>[-]>[-]>[-]<<<<<
[->-[>+>>]>[[-<+>]+>+>>]<<<<<]
>>-[-<<+>>]
<[-]++++++++[-<++++++>]
>>[-<<+>>]
<<
]
<[.[-]<]
<
>>+++++++++++++.---.[-]<<
Set divisor to 2
>++>+<< [->-[>+>>]>[[-<+>]+>+>>]<<<<<]
>>> ]

View file

@ -0,0 +1,15 @@
IDENTIFICATION DIVISION.
PROGRAM-ID. Loop-While.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 I PIC 9999 VALUE 1024.
PROCEDURE DIVISION.
PERFORM UNTIL NOT 0 < I
DISPLAY I
DIVIDE 2 INTO I
END-PERFORM
GOBACK
.

View file

@ -0,0 +1,5 @@
var val = 1024;
while val > 0 {
writeln(val);
val /= 2;
}

View file

@ -0,0 +1,5 @@
x = 1024
while x > 0
echo x
x //= 2
end

View file

@ -0,0 +1,4 @@
(let ((i 1024))
(while (> i 0)
(message "%d" i)
(setq i (/ i 2))))

View file

@ -0,0 +1,7 @@
integer i
i = 1024
while i > 0 do
printf(1, "%g\n", {i})
i = floor(i/2) --Euphoria does NOT use integer division. 1/2 = 0.5
end while

View file

@ -0,0 +1,6 @@
var i = 1024;
while (i > 0) {
Sys.println(i);
i >>= 1;
}

View file

@ -0,0 +1,6 @@
var i = 1024;
while (i > 0) {
Sys.println(i);
i = Std.int(i / 2);
}

View file

@ -0,0 +1,5 @@
def i = 1024
while (i > 0) {
println i
i /= 2
}

View file

@ -0,0 +1,5 @@
[int]$i = 1024
while ($i -gt 0) {
$i
$i /= 2
}

View file

@ -0,0 +1,68 @@
# riscv assembly raspberry pico2 rp2350
# program loopwhile1.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,1024
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
srli s0,s0,1 # division by 2
bgtz s0,1b # >= 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,5 @@
let n = ref(1024)
while n.contents > 0 {
Js.log(n.contents)
n := n.contents / 2
}

View file

@ -0,0 +1,10 @@
REBOL [
Title: "Loop/While"
URL: http://rosettacode.org/wiki/Loop/While
]
value: 1024
while [value > 0][
print value
value: to integer! value / 2
]

View file

@ -0,0 +1,5 @@
n:: 1024
while { n > 0 } {
print n
n:: n // 2
}

View file

@ -0,0 +1,8 @@
var i = integer
i = 1024
while i > 0 do
begin
print i;
i = i / 2
end
end

View file

@ -0,0 +1,5 @@
x = 1024
lblhalve
printInt x
x / 2
if x halve

View file

@ -0,0 +1,4 @@
1024
c ← >0
⍢(⌊÷2⊸&p|c)