EasyManuals Logo

Tandy 1000 Basic Reference Manual

Default Icon
411 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #299 background imageLoading...
Page #299 background image
Chapter
10
I
BASIC
Keywords
RND
Function
RND[(nurnber)]
Returns a random number in the range
0
and
1.
BASIC uses the current seed when generating a random number
and produces the same sequence
of
random numbers each time
the program is run unless you reseed the random number gener-
ator. Use the RANDOMIZE statement
to
reseed the random
number generator
If
number
is negative, RND starts the sequence
of
random num-
bers at the beginning. If
number
is
0,
RND repeats the last
number generated. If you omit
number
or
specify
a
positive
value, RND returns the next number in the sequence.
Example
PRINT RND(1
1
prints the next decimal fraction in the sequence.
Sample Program
10
FOR
I
=
1
TO
5
20 PRINT INT(RND*l00);
30
NEXT
I
This program produces
5
random integers. Line
20
converts the
decimal fraction returned by RND to
a
real number and trun-
cates the real number
to
an integer.
297

Table of Contents

Other manuals for Tandy 1000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tandy 1000 and is the answer not in the manual?

Tandy 1000 Specifications

General IconGeneral
ProcessorIntel 8088
Processor Speed4.77 MHz
RAM128 KB (expandable to 640 KB)
Operating SystemMS-DOS 2.11
ManufacturerTandy Corporation
Release Year1984
StorageSingle or double 5.25" floppy disk drive (360 KB), optional hard drive
SoundTandy 3-voice sound
PortsParallel, Serial
GraphicsCGA (Color Graphics Adapter)
Graphics Modes320x200, 640x200

Related product manuals