Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,18 +0,0 @@
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

@ -1,26 +0,0 @@
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

@ -1,11 +0,0 @@
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,10 +0,0 @@
(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

@ -1,9 +0,0 @@
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

@ -1,12 +0,0 @@
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

@ -1,20 +1,7 @@
]F.(( _2 Z: 10&= [ echo)@(?@20))''
15
6
5
10
]F.(( _2 Z: 10&= [ echo)@(?@20))''
14
9
]F.((echo@?@20 [ _2 Z: 10&= [ echo)@?@20)''
3
8
19
14
5
18
7
13
8
1
19
2
10
10

View file

@ -1,7 +1 @@
loopexample=: {{
while. do.
echo k=. ?20
if. 10=k do. return. end.
echo ?20
end.
}}
]F.((echo@?@20`(_2 Z:1:)@.(10&=) [ echo)@?@20)''

View file

@ -1,7 +1,20 @@
loopexample2=: verb define
while. do.
echo k=. ?20
if. 10=k do. break. end.
echo ?20
end.
)
]F.((_2 Z: 10&= [ echo)@?@20)''
15
6
5
10
]F.((_2 Z: 10&= [ echo)@?@20)''
14
9
3
8
19
14
5
13
8
1
19
2
10

View file

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

View file

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

View file

@ -1,16 +0,0 @@
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

@ -4,12 +4,12 @@ import rand.seed
fn main() {
rand.seed(seed.time_seed_array(2))
for {
a := rand.intn(20)?
a := rand.intn(20)!
println(a)
if a == 10 {
break
}
b := rand.intn(20)?
b := rand.intn(20)!
println(b)
}
}

View file

@ -1,17 +0,0 @@
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