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,18 @@
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Numerics.Discrete_Random;
procedure Test_Loop_Break is
type Value_Type is range 0..19;
package Random_Values is new Ada.Numerics.Discrete_Random (Value_Type);
use Random_Values;
Dice : Generator;
A, B : Value_Type;
begin
loop
A := Random (Dice);
Put_Line (Value_Type'Image (A));
exit when A = 10;
B := Random (Dice);
Put_Line (Value_Type'Image (B));
end loop;
end Test_Loop_Break;

View file

@ -0,0 +1,26 @@
IDENTIFICATION DIVISION.
PROGRAM-ID. Random-Nums.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 Num PIC Z9.
PROCEDURE DIVISION.
Main.
PERFORM FOREVER
PERFORM Generate-And-Display-Num
IF Num = 10
EXIT PERFORM
ELSE
PERFORM Generate-And-Display-Num
END-IF
END-PERFORM
GOBACK
.
Generate-And-Display-Num.
COMPUTE Num = FUNCTION REM(FUNCTION RANDOM * 100, 20)
DISPLAY Num
.

View file

@ -0,0 +1,11 @@
use Random;
var r = new RandomStream();
while true {
var a = floor(r.getNext() * 20):int;
writeln(a);
if a == 10 then break;
var b = floor(r.getNext() * 20):int;
writeln(b);
}
delete r;

View file

@ -1,7 +1,7 @@
for ever
int a = random(20)
int a random(20)
write(a)
if a == 10 do break end
if a æ 10 do break end
writeLine("," + random(20))
end
writeLine()

View file

@ -1,6 +1,6 @@
repeat
a = random 20 - 1
a = random 0 19
print a
until a = 10
print random 20 - 1
print random 0 19
.

View file

@ -0,0 +1,10 @@
(defun wait_10 ()
(catch 'loop-break
(while 't
(let ((math (random 19)))
(if (= math 10)
(progn (message "Found value: %d" math)
(throw 'loop-break math))
(message "current number is: %d" math) ) ) ) ) )
(wait_10)

View file

@ -0,0 +1,9 @@
integer i
while 1 do
i = rand(20) - 1
printf(1, "%g ", {i})
if i = 10 then
exit
end if
printf(1, "%g ", {rand(20)-1})
end while

View file

@ -0,0 +1,12 @@
class Program {
static public function main():Void {
while(true) {
var a = Std.random(20);
Sys.println(a);
if (a == 10)
break;
var b = Std.random(20);
Sys.println(b);
}
}
}

View file

@ -0,0 +1,7 @@
loopexample2=: verb define
while. do.
echo k=. ?20
if. 10=k do. break. end.
echo ?20
end.
)

View file

@ -0,0 +1,8 @@
loopexample3=: {{
while. do.
echo k=. ?20
if. 10=k do. goto_done. end.
echo ?20
end.
label_done.
}}

View file

@ -0,0 +1,6 @@
while (true) {
def x = random(20)
println x
break if x == 10
println random(20)
}

View file

@ -0,0 +1,9 @@
$r = New-Object Random
for () {
$n = $r.Next(20)
Write-Host $n
if ($n -eq 10) {
break
}
Write-Host $r.Next(20)
}

View file

@ -0,0 +1,16 @@
REBOL [
Title: "Loop/Break"
URL: http://rosettacode.org/wiki/Loop/Break
]
random/seed 1 ; Make repeatable.
; random/seed now ; Uncomment for 'true' randomness.
r20: does [(random 20) - 1]
forever [
prin x: r20
if 10 = x [break]
print rejoin [" " r20]
]
print ""

View file

@ -0,0 +1,5 @@
Rnd ← (⌊×20⚂)
po ⍢ (
⊸&pRnd◌
⍥(&pRnd)⊸≠10
|≠10) 0

View file

@ -0,0 +1,6 @@
Rnd ← (⌊×20⚂)
Loop ←|0.0 (
≠10 ⊸&pRnd
⍥ (Loop &p Rnd)
)
Loop

View file

@ -0,0 +1 @@
⍣(⍢(&p$"\t_"⚂₂₀⍥(°0 1)=₁₀⊸&pf⚂₂₀|1)|&p"\nended")

View file

@ -0,0 +1,17 @@
Dim a, b, i
Do
a = Int(Rnd * 20)
WScript.StdOut.Write a
If a = 10 Then Exit Do
b = Int(Rnd * 20)
WScript.Echo vbNullString, b
Loop
For i = 1 To 100000
a = Int(Rnd * 20)
WScript.StdOut.Write a
If a = 10 Then Exit For
b = Int(Rnd * 20)
WScript.Echo vbNullString, b
Next