retroforth/interface/rng.retro
crc 16d5df0dc8 add source info for i/o words
FossilOrigin-Name: 4e07d2424d6b43867789fe2d25ec1b794ec3511eba5c9beefcfdc2a38344c0c4
2021-08-23 13:23:10 +00:00

14 lines
371 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 s:keep d:last d:source store
~~~