Radio Shack TRS-80 User Manual page 204

Micro computer system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

PartC:
Some
User's
Programs
mmsmmmsffla^mmmmmmmmmmMmmmmmmmm
Test
Grader Program
10
REM
*
TEST GRADER
*
ze
cls
30
A=l
40 B=a
50
C
= 3
60
D
=
4
72 E
= 5
se
t=ib
90
F=ll
100
N=la
110
P.
"WOULD
YOU LIKE
TO
INPUT
THE
ANSWERS"
120
P.
"ONE
AT
A
TIME
OR
5
AT
A
TIME (ENTER
1
OR
51";
iIN.T
1
30 IF (T=l
]
+
(
T=5
)
GOTO
150
140
GOTO
120
150 IN.
"ENTER
THE
STUDENT'S NAME
(LAST NAME, FIRST
NAME)"jAS.
BJ
160
CLS;
p.
"TEST
FOR
";BS;"
" |AS
1?0
REST,
190
R=0
190
FOR
1=1
TO
N
STEP
T
220
P.
"ENTER
ANSWER"
|
i
IF
T=5
P.
"S
"
I
I
;
"THROUGH
"
t
ZIB
P.
I+T-l|
2
20
IF
T = 5
IN. At I),
A<
1
+
1),
At
1
+
2),
At
1+3),
M
1
+
4) iG.
240
2
30
IN.
A(I)
202
240 NEXT
I
250 CLS
260
P,"
RESULTS
ON
TEST FROM
"
iBt|"
"
[A*j"
i'
270 FOR
1=1
TO
N
280
P
.
At
1
)
t
290 READ
2
300 P,Z,
310
IF
A(I)=Z
P.
"CORRECT
"|
j
R=R+1
320
P,
330 NEXT
I
340
P.
"PERCENTAGE
CORRECT:"
)
I
NT
[
R/N* 00+
.
5
350
P.
360
G.150
370
DATA
5, 3,
,
D
,
C
,
E
T
,
T
,
F
,
mm
Slowpoke
The
kiddies (of
all
ages)
will
enjoy
this
one.
It
tests
reaction time.
When
the
com-
puter
says
"G",
you
press
any key
to
stop
it.
Then
it's
the
next
player's
turn to
RUN
it.
The
player
who
stops
it
on
the smallest
number
wins.
Any
player
who
gets
a
"SLOWPOKE"
has
to
go
take
the
dog
for
a
walk.
With
a
little
easy
rework of
the
PRINT
statements
it
can be converted
into a
"drunkometer"
reaction
time
tester.
To
change
the
speed of
the printing,
you
can add
a short
FOR-NEXT
loop
between
190 and
200.
10
PRINT
"
GET READY
.
.
,
20 POR
B =
1
TO
500
30
NEXT
B
40
PRINT
50
PRINT
60
PRINT
70
PRINT
TABOO)
,
"GET
SET

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents