EasyManua.ls Logo

Texas Instruments TI-99/4A - Page 115

Texas Instruments TI-99/4A
204 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
RANDOMIZE Statement
RANDOMIZE
Iseed!
The
RANDOMIZE
statement
is
used
In
conjunction with the
random
number
function (RND). When the
RANDOMIZE
statement
is
not
used,
the
random
number
function will
generate
the
same
sequence of
pseudo·random
numbers
each
time
the
program
is run. When the
RANDOMIZE
statement
is used without
a
seed, a different
and
unpredictable
sequence
of
random
numbers
is
generated
by the random
number
function
each
time the
program
is run.
If
you
use
the
RANDOMIZE
statement
with
a
seed
specified. then the
sequence
of
random
numbers
generated
by the
random
number
function depends upon
the
value of
the
seed
It
the
same
seed is used each time the program is run,
then
the
same
sequence
of
numbers
is
generated,
If
a different
seed
is used each
time the program is run,
then
a different sequence of
numbers
is
generated.
The
seed may
be
any
numeric expression.
The
number
actually used for the seed
is
the first two bytes
of
the internal
representation
of the number.
(See
"Accuracy Information" in the
Appendix for a complete explanation.)
Thus,
it is possible
that
the
same
sequence
of
numbers
may
be
generated
even
if
you
specify different
seeds.
For
example.
RANDOMIZE
1000
and
RANDOMIZE
1099
produce
the
same
first two bytes internally
and
thus
the
same
sequence
of
numbers
If
the
seed
you specify is
not
an
integer.
then
the
value used is
INT
(seed) (see ·'INT·
Integer").
User's Reference Guide
Examples:
>NEW
>100
RANDOMIZE
23
>110
FOR
1-1
TO
5
>120
PRINT
INT(10*RND)+1
>130
NEXT
I
>140
STOP
>RUf<I
6
4
3
8
B
**
DONE
**
1I·95

Other manuals for Texas Instruments TI-99/4A

Related product manuals