retroforth/interface/rng.retro
crc 7c29018d11 more use of d:set-source instead of raw lookup/patching for initial source data; remove NoEcho variable
FossilOrigin-Name: 6e56f20570a58f1e5a7782f7a26a3cdeaa2af17b6a58f46a63ba509366306ebf
2023-04-12 00:34:17 +00:00

15 lines
366 B
Forth

# Random Number Generator
I/O device type 10 is a random number generator. I do this as
part of the VM I/O extensions to allow implementors to use the
best approach on their host system.
~~~
:n:random (-n)
#10 io:scan-for
dup n:negative? [ drop 'Error:_device_(0010)_not_found s:put nl ] if;
io:invoke ;
'interface/rng.retro 'n:random d:set-source
~~~