Random
Back to current versionRestore this version

Creating Random numbers #

this code is Atari 8bit specific, as its using the POKEY chip as the source for randomness

: RND ( -- n ) \\ Random Number 0-$FF
  $D20A C@ ;

\\ Random Numner 0..n-1
: RANDOM ( n -- 0..n-1 )
  RND $100 * RND + UM* NIP ;