EasyManuals Logo

Atari XL User Manual

Atari XL
262 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 #47 background imageLoading...
Page #47 background image
Program
Control
37
20 DIM
NUM(10),SORT(10)
30
REM
INPUT
10
NUMBERS
40
PRINT"
'\."
50
FOR
N=l
TO
10
60 PRINT "ENTER A NUMBER";: INPUT
NUMBER
70
NUM(N)=NUMBER
80
NEXT
N
100
REM
COpy
NUMBERS
TO
ARRAY
SORT
110
FOR
C=1 TO
10
120
SORT(C) =
NUM(C)
130
NEXT
C
200
REM
SORT
NUMBERS
210
COUNT
=0
220
FOR
N=l
TO 9
230
IF
SORT(N+l)
>=
SORT(N)
THEN
280
240
TEMP
=
SORT(N+l)
250
SORT(N+l)
= SORT(N)
260
SORT(N) =
TEMP
270
COUNT
=
COUNT
+ 1
280
NEXT
N
300
IF
COUNT
> 0
THEN
210
310
FOR
Z=1 TO
10
320
PRINT
NUM(Z),SORT(Z)
330
NEXT
Z
The
REMarks
indicate
the
functions
of
the
different
sections
of
the
program,
which
works
like
this:
Line
20
dimensions
the
two
arrays
used
in
the
program.
Lines
40 to 80
input
ten
numbers
from
the
keyboard
and
store
them
in
the
array
NUM(
),
using
a
FOR
...
NEXT
loop.
Lines
110
to 130 copy
the
numbers
from
NUM(
)
to a
second
array
SORT( )
which
will
be sorted,
while
NUM
retains
the
numbers
in
the
order
in

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atari XL and is the answer not in the manual?

Atari XL Specifications

General IconGeneral
Release Year1983
CPUMOS Technology 6502C
GraphicsANTIC, GTIA
SoundPOKEY (4 channels)
StorageCassette tape
PortsCartridge
Operating SystemAtari BASIC
CPU Speed1.79 MHz
RAM64 KB

Related product manuals