Data update

This commit is contained in:
Ingy döt Net 2025-06-11 20:16:52 -04:00
parent 72eb4943cb
commit 4d5544505c
2347 changed files with 62432 additions and 16731 deletions

View file

@ -1,13 +1,11 @@
main: (
INT a, b;
INT seed := 4; # chosen by a fair dice roll, guaranteed to be random c.f. http://xkcd.com/221/ #
# first random; #
#main#
(
WHILE
a := ENTIER (next random(seed) * 20);
INT a = ENTIER (random * 20);
print((a));
# WHILE # NOT (a = 10) DO
b := ENTIER (next random(seed) * 20);
print((b, new line))
a /= 10
DO
print((ENTIER (random * 20), new line))
OD;
print(new line)
)

View file

@ -0,0 +1,12 @@
import ballerina/io;
import ballerina/random;
public function main() returns error? {
while true {
int n = check random:createIntInRange(0, 20);
io:println(n);
if n == 10 { break; }
n = check random:createIntInRange(0, 20);
io:println(n);
}
}

View file

@ -0,0 +1,62 @@
%newline { [ LIT2 0a -Console/write ] DEO }
%tab { [ LIT2 09 -Console/write ] DEO }
%MOD ( a b -- a%b ) { DIVk MUL SUB }
|18 @Console/write
|c0 @DateTime/year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1
|100
rand/init
&loop
rand/0:13 DUP print/dec tab
#0a NEQ ?{
newline !&break }
rand/0:13 print/dec newline
!&loop
&break
BRK
@print/dec ( dec -- )
DUP #64 DIV /num
DUP #0a DIV /num
( >> )
@print/num_ ( num -- )
#0a DIVk MUL SUB [ LIT "0 ] ADD .Console/write DEO
JMP2r
@print/num ( num -- )
DUP ?&num_
POP
JMP2r
@rand/init ( -- )
[ LIT2 00 -DateTime/second ] DEI
[ LIT2 00 -DateTime/minute ] DEI #60 SFT2 EOR2
[ LIT2 00 -DateTime/hour ] DEI #c0 SFT2 EOR2 ,&x STR2
[ LIT2 00 -DateTime/hour ] DEI #04 SFT2
[ LIT2 00 -DateTime/day ] DEI #10 SFT2 EOR2
[ LIT2 00 -DateTime/month ] DEI #60 SFT2 EOR2
.DateTime/year DEI2 #a0 SFT2 EOR2 ,&y STR2
JMP2r
@rand/short ( -- number* )
[ LIT2 &x $2 ]
DUP2 #50 SFT2 EOR2
DUP2 #03 SFT2 EOR2
[ LIT2 &y $2 ] DUP2 ,&x STR2
DUP2 #01 SFT2 EOR2 EOR2
,&y STR2k POP
JMP2r
@rand/byte ( -- number )
/short AND
JMP2r
@rand/0:13 ( -- U[0,13] )
/byte #14 MOD
JMP2r