5cf232571e
FossilOrigin-Name: e078c14150ce5721f0b21ebd458b1d0104a1ed6f413362e6a8ca15790869edb0
16 lines
299 B
Text
16 lines
299 B
Text
## Random Number Generator
|
|
|
|
~~~
|
|
{{
|
|
'io var
|
|
:identify
|
|
@io n:zero? [
|
|
#10 io:scan-for dup n:negative?
|
|
[ drop 'IO_DEVICE_TYPE_0010_NOT_FOUND s:put nl ]
|
|
[ !io ] choose ] if ;
|
|
---reveal---
|
|
:io:rng-operation identify @io io:invoke ;
|
|
}}
|
|
|
|
:n:random (-n) io:rng-operation ;
|
|
~~~
|