Train
Description
by Walt Koetke in the MoHPC - General Software Library
TRAIN is a program which uses the computer to generate problems with random initial conditions to teach about the time-speed-distance relationship (distance = rate x time). You then input your answer and the computer verifies your response.
TRAIN is merely an example of a student-generated problem. Maximum fun (and benefit) comes more from writing programs like this as opposed to solving the specific problem posed. Exchange your program with others -- you solve their problem and let them solve yours.
TRAIN was originally written in FOCAL by one student for use by others in his class. It was submitted to us by Walt Koetke, Lexington High School, Lexington, Mass.
Instructions:
The calculator shows:
- Number: Means the number shown. Press R/S to continue
- Complex number: The text with that number. Look up the text below, then press R/S to continue
- Train
- Creative Computing Morristown, New Jersey
- Time - Speed distance exercise
- A car traveling
- mph can make a certain trip in
- hours less than a train traveling at
- mph.
- How long does the trip take by car?
- Good! Answer within
- percent.
- sorry. You were off by
- correct answer is
- hours.
- Another problem (Yes or No)?
- Blinking: Input required. Enter a number, then press R/S to continue (you don't have to press ENTER)
Time - Speed distance exercise:
A car traveling 54 mph can make a certain trip in 11 hours less than a train traveling at 36 mph. How long does the trip take by car?
Program Resources
Labels
Name |
Description |
|
B |
Start Train Game |
|
0 |
# |
|
1 |
# |
|
2 |
# |
|
3 |
# |
|
Storage Registers
Name |
Description |
|
0 |
|
|
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
I |
|
|
Flags
Program
Line |
Display |
Key Sequence |
|
Line |
Display |
Key Sequence |
|
Line |
Display |
Key Sequence |
|
000 |
|
|
|
053 |
44 2 |
STO 2 |
|
106 |
48 |
. |
|
001 |
42,21, 0 |
f LBL 0 |
|
054 |
1 |
1 |
|
107 |
5 |
5 |
|
002 |
31 |
R/S |
|
055 |
9 |
9 |
|
108 |
40 |
+ |
|
003 |
43, 5, 8 |
g CF 8 |
|
056 |
42 36 |
f RAN # |
|
109 |
43 44 |
g INT |
|
004 |
43 32 |
g RTN |
|
057 |
20 |
× |
|
110 |
44 3 |
STO 3 |
|
005 |
42,21, 1 |
f LBL 1 |
|
058 |
43 44 |
g INT |
|
111 |
1 |
1 |
|
006 |
16 |
CHS |
|
059 |
2 |
2 |
|
112 |
3 |
3 |
|
007 |
44 25 |
STO I |
|
060 |
0 |
0 |
|
113 |
3 |
3 |
|
008 |
42,21, 2 |
f LBL 2 |
|
061 |
40 |
+ |
|
114 |
16 |
CHS |
|
009 |
22 25 |
GTO I |
|
062 |
44 4 |
STO 4 |
|
115 |
44 25 |
STO I |
|
010 |
42,21, 3 |
f LBL 3 |
|
063 |
43, 4, 8 |
g SF 8 |
|
116 |
5 |
5 |
|
011 |
16 |
CHS |
|
064 |
4 |
4 |
|
117 |
45 3 |
RCL 3 |
|
012 |
34 |
x↔y |
|
065 |
32 0 |
GSB 0 |
|
118 |
43,30, 7 |
g TEST x>y |
|
013 |
1 |
1 |
|
066 |
45 1 |
RCL 1 |
|
119 |
22 25 |
GTO I |
|
014 |
30 |
− |
|
067 |
32 0 |
GSB 0 |
|
120 |
43, 4, 8 |
g SF 8 |
|
015 |
43,30, 0 |
g TEST x≠0 |
|
068 |
43, 4, 8 |
g SF 8 |
|
121 |
9 |
9 |
|
016 |
43 32 |
g RTN |
|
069 |
5 |
5 |
|
122 |
32 0 |
GSB 0 |
|
017 |
33 |
R⬇ |
|
070 |
32 0 |
GSB 0 |
|
123 |
45 3 |
RCL 3 |
|
018 |
44 25 |
STO I |
|
071 |
45 2 |
RCL 2 |
|
124 |
32 0 |
GSB 0 |
|
019 |
43 33 |
g R⬆ |
|
072 |
32 0 |
GSB 0 |
|
125 |
43, 4, 8 |
g SF 8 |
|
020 |
43 32 |
g RTN |
|
073 |
43, 4, 8 |
g SF 8 |
|
126 |
1 |
1 |
|
021 |
42,21,12 |
f LBL B |
|
074 |
6 |
6 |
|
127 |
0 |
0 |
|
022 |
43, 4, 8 |
g SF 8 |
|
075 |
32 0 |
GSB 0 |
|
128 |
32 0 |
GSB 0 |
|
023 |
0 |
0 |
|
076 |
45 4 |
RCL 4 |
|
129 |
1 |
1 |
|
024 |
32 0 |
GSB 0 |
|
077 |
32 0 |
GSB 0 |
|
130 |
4 |
4 |
|
025 |
43, 4, 8 |
g SF 8 |
|
078 |
43, 4, 8 |
g SF 8 |
|
131 |
3 |
3 |
|
026 |
1 |
1 |
|
079 |
7 |
7 |
|
132 |
22 1 |
GTO 1 |
|
027 |
32 0 |
GSB 0 |
|
080 |
32 0 |
GSB 0 |
|
133 |
43, 4, 8 |
g SF 8 |
|
028 |
43, 4, 8 |
g SF 8 |
|
081 |
43, 4, 8 |
g SF 8 |
|
134 |
1 |
1 |
|
029 |
0 |
0 |
|
082 |
8 |
8 |
|
135 |
1 |
1 |
|
030 |
32 0 |
GSB 0 |
|
083 |
32 0 |
GSB 0 |
|
136 |
32 0 |
GSB 0 |
|
031 |
43, 4, 8 |
g SF 8 |
|
084 |
43, 4, 9 |
g SF 9 |
|
137 |
45 3 |
RCL 3 |
|
032 |
2 |
2 |
|
085 |
31 |
R/S |
|
138 |
32 0 |
GSB 0 |
|
033 |
32 0 |
GSB 0 |
|
086 |
43, 5, 9 |
g CF 9 |
|
139 |
43, 4, 8 |
g SF 8 |
|
034 |
43, 4, 8 |
g SF 8 |
|
087 |
44 0 |
STO 0 |
|
140 |
1 |
1 |
|
035 |
3 |
3 |
|
088 |
45 2 |
RCL 2 |
|
141 |
0 |
0 |
|
036 |
32 0 |
GSB 0 |
|
089 |
45 4 |
RCL 4 |
|
142 |
32 0 |
GSB 0 |
|
037 |
2 |
2 |
|
090 |
20 |
× |
|
143 |
43, 4, 8 |
g SF 8 |
|
038 |
5 |
5 |
|
091 |
45 1 |
RCL 1 |
|
144 |
1 |
1 |
|
039 |
42 36 |
f RAN # |
|
092 |
45 4 |
RCL 4 |
|
145 |
2 |
2 |
|
040 |
20 |
× |
|
093 |
30 |
− |
|
146 |
32 0 |
GSB 0 |
|
041 |
43 44 |
g INT |
|
094 |
10 |
÷ |
|
147 |
45 5 |
RCL 5 |
|
042 |
4 |
4 |
|
095 |
44 5 |
STO 5 |
|
148 |
32 0 |
GSB 0 |
|
043 |
0 |
0 |
|
096 |
45 5 |
RCL 5 |
|
149 |
43, 4, 8 |
g SF 8 |
|
044 |
40 |
+ |
|
097 |
45 0 |
RCL 0 |
|
150 |
1 |
1 |
|
045 |
44 1 |
STO 1 |
|
098 |
30 |
− |
|
151 |
3 |
3 |
|
046 |
1 |
1 |
|
099 |
1 |
1 |
|
152 |
32 0 |
GSB 0 |
|
047 |
5 |
5 |
|
100 |
0 |
0 |
|
153 |
43, 4, 8 |
g SF 8 |
|
048 |
42 36 |
f RAN # |
|
101 |
0 |
0 |
|
154 |
1 |
1 |
|
049 |
20 |
× |
|
102 |
20 |
× |
|
155 |
4 |
4 |
|
050 |
43 44 |
g INT |
|
103 |
45 0 |
RCL 0 |
|
156 |
32 0 |
GSB 0 |
|
051 |
5 |
5 |
|
104 |
10 |
÷ |
|
157 |
31 |
R/S |
|
052 |
40 |
+ |
|
105 |
43 16 |
g ABS |
|
|
|
|
|