Random Pokes

Pub Details: Sinclair Timex User Group Newsletter v2 n6 (Volume 2, Issue 6)
Date: June 1983
Pages: 3

The RAND command sets the 2-byte system variable SEED, which is located at addresses 16434 and 16435. The variable is set to the expression following RAND (except RAND 0–what happens then?). Unlike functions, the expression does not require enclosing parentheses. We tell you this because to do USR calls many people use: RAND USR address. If you don’t want the “side-effect” of changing the random number seed in USR calls, try: IF USR address THEN.

If you are not using the random number seed, there is a simple way to convert a floating-point number N into a 2-byte integer. Replace the two statements, POKE 16435, N/256 and POKE 16434, N-256*INT (N/256), by RAND N.