EasyManuals Logo

Atari 800 Basic Reference Manual

Atari 800
122 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 #102 background imageLoading...
Page #102 background image
BUBBLE SORT
This
program
uses
the
string
comparison
operator"<="
that
orders
strings
ac-
cording
to
the
AT
ASCII values
of
the
various
characters.
Since
Atari
BASIC
does
not
have
arrays
of
strings,
all
the
strings
used
in
this
program
are
actually
substrings
of
one
large
string.
A
bubble
sort,
though
relatively
slow
ifthere
are
a lot
of
items
to
be
stored,
is
easy
to
write,
fairly
short,
and
simpler
to
under-
stand
than
more
complex
sorts.
10
DU1
8$(
1)
~'0
GRAPHICS
0 : ?
.
·~
II
..
STF.:
I
t·lG
:;o
RT"
=?
30
TRAP
30=?
:7
11
Ent.er·
ifta>::iiltl_.liil
str·lns
le
ngth
11
; :
H~PUT
~tEt-l:
SLEf-H=SLHl-1
35 IF
SLHl<
1
OR
HlTC3LHD<
>SLHl
THHi
?
II
PLEASE
Et-HEP
A
P03
IT
I!.}£
I
t·HEGEP
> 0 .
11
:
GO
TO
30
40
TRAP
40: ?
=?
"Enter·
111a>::
l
iftlAiit
nt.lfftbe;-·
of
ent.r·
ies
. "
41
?
!I
(
Entr·
.i
es
l.(ih
.i
d-,
are shor·t.er·
than
t.h
e
tna;dt'itUfft
'.•.till
be
t=·added
'
-'JiU-,
blanks
. )
II
42
INPJJT
ENT~~
I
ES
45
IF
HHF.~IE:3<2
Of;~
IHT(
Ef.~TPIE::;
><
>Hm~:IE
:
:;
THEt·l
?
11
PLEASE
HHER
A
POSIT
I
lJE
I
r~TEGER
>
1.
11
=GOTO
40
47
TRAP
40(10~)
50
Dit1
A$(
:3LEt·t
;;
(ENT~
~
IE~:;
),,
iEt·
1F'$(
~:
t
..
Et·i)
60
? : ? "Enter·
st.r-
.i.
n::.s
•:.ne
at
a
t.
i
1ne
. u
70 ? "Enter·
e111Ph.t
str·
in::;.
!.•.ih~n
done ( .iust.
hi
t.~:ETUPr·i
>.
II
75
·?
:?
11
PLEA:3E
STAt·~D
8\"'
~~JHILE
THE
:3TRii·~
GS
ARE
BE
I
r·~G
CLEAPED
. . . "
.;
80
FOF~
I
=1
TO
SLEf-t
:
;~Ef·~TPIE::;
:
A!.(
I .' I
>=u
":
t
·
~
E::<T
I
85
·?
:?
90
I=l
101-)
FOP
.J=l
TO
HlTRIE::;
110 ?
"#"
,;
,
J;
II
II;
:
HlPUT
TH1P$
120
IF
LEN
(
TEt-1P$
)=0
THEf
·i
Et
·
~
T~:IE
:
:;=
.
...l-1:
GOT
0
190
130
A$(
I
..
I
+::;LB·i
1
)=
TEt'iP$
140 I= I
+::;LEt-4
150
~lE:-=:T
J
190
? :?
:?
"PLEASE
~:TAr·[!
E:\'
1·~HILE
THE
~::
TR!HGS
ARE
BEWG
:::OF.:TEO
...
II
,;
200
GOSUB
1000
:
REt·1
CALL
SOF~T
ROUT
H-IE
202
·?
:?
205
I=l
210
FOR
K=l
TO
Etn~~IE:::
220?
"#";K;"
";A$(!,I+SLEN1)
225
I=
I
+SLD·i
230
NE:=<T
K
24€1
TRAP
330
:
·-;--
:?
"WOULD
YOU
LIKE A
PR
Hi
Appendix
H-5

Table of Contents

Other manuals for Atari 800

Questions and Answers:

Question and Answer IconNeed help?

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

Atari 800 Specifications

General IconGeneral
ProcessorMOS Technology 6502
Processor Speed1.79 MHz
ROM10 KB
GraphicsANTIC and GTIA chips
Release Year1979
Display Resolutionup to 320 x 192
Colors128 colors
Sound4 channels
StorageCartridge, cassette, floppy disk
PortsCartridge, serial, monitor
Operating SystemAtari OS

Related product manuals