retroforth/source/interfaces/io/rng.retro
crc 078d98e8cf rng: move xorshift and mersenne into the examples
FossilOrigin-Name: 78d70988db343fada5bb205cc23fd5ad0282d9e5dc7305eaef607cb941e19db1
2019-09-30 18:34:57 +00:00

17 lines
283 B
Text

## Random Value
Return a random value from /dev/urandom
~~~
{{
:random:byte
'/dev/urandom file:R file:open
&file:read sip file:close ;
---reveal---
:n:random
random:byte #-8 shift
random:byte + #-8 shift
random:byte + #8 shift
random:byte + ;
}}
~~~