EasyManua.ls Logo

Radio Shack TRS-80 - Page 132

Radio Shack TRS-80
236 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
Loading...
True
52
card
values
are
printed
on the
screen,
but
if you
look
carefully,
the same number
appears
more
than
once.
This
means that
some
"cells"
are not
being
READ
and some READ
more
than
once.
Step
3:
When a
card is
drawn,
set its
array
address
equal to
zero.
Test
each
card drawn to
be
sure
it
is not
0,
When
52
cards
have
been
drawn
and
printed,
type
END OF
DECK.
90
p
=
52
105
IF
A( V)
=
G.
100
120 A< V)
=
130
p
=
P
-
1
140
IF
P<>
GOTO
100
150
PRINT
"END
OF
DECK!"
Line
120
sets
the
value
in
cell
A(V)
equal
to
zero
only
if
line
105
finds it NOT
equal to zero
already,
letting
the
program
pointer
fall
through.
When
a
"fall
through"
occurs:
1.
The
card's
value is
printed
(line
110)
2.
The
number
stored
in
that
cell
is set to
zero
(line
120)
3.
Line
130
counts
down
the
number
of
cards
printed.
Line
90
initialized
the
number
of
prints
at
52.
4.
The
number
of
prints
is
tested
(line 140).
When
there
are no
more
prints to go,
END
OF
DECK!
is
printed
(line
150).
Pretty slick
and
you
don't
have
to
watch the
dealer
(just the
programmer).
But how
do
you
really
know
that
every
card has
been
dealt?
Write a
quick
addition to
the
program
to
"interrogate"
each
array
cell
and
print its
contents.
130

Other manuals for Radio Shack TRS-80

Related product manuals