-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtrip2.txt
236 lines (236 loc) · 3.33 KB
/
trip2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
%%HP: T(1)A(D)F(.);
DIR
UNITS
« { '1_gal' '1_
1/gal' '1_mi' '1_1/
mi' '1_km' '1_1/km'
'1_d' '1_1/d' '1_h'
'1_1/h' '1_mi/h' '1
_km/h' } TMENU
»
JOURN
DIR
TEST { {
"BEND" "PORTLAND" }
'1000_mi' '50_mi/h'
'10_mi/gal' '1_1/
gal' '10_1/d' '0_1/
d' { 5.252022 8 } }
REPLACE
« OBJ
UPDIR DROP 'STARTT'
STO 'GAS$' STO
'EAT$' STO 'MISC$'
STO 'MPG' STO
'RATE' STO 'DIST'
STO 'TO' STO
SUMMARY
»
END
DIST '1000_mi'
RATE '10_mi/h'
MPG '10_mi/gal'
TANK '10_gal'
DRIVE '10_h'
GAS$ '1_1/gal'
EAT$ '0_1/d'
MISC$ '0_1/d'
DAYS
« DIST RATE /
DRIVE / HMS IP
»
GAS
« DIST MPG /
»
REFUEL
« GAS TANK / 1
RND
»
TO { "BEND"
"PORTLAND" }
STARTT { 1.012023
8 }
APP
« F2T SET$ SETU
SUMMARY
»
F2T
« "FROM TO" {
{ "FROM:"
"FROM ORIGIN" 2 } {
"TO:"
"TO DESTINATION" 2
} { "DATE:"
"DEPART ON (EX: 12.312022)"
0 } { "TIME:"
"DEPART AT (EX: 11.2959)"
0 } } { 1 4 } { }
TO OBJ DROP STARTT
OBJ DROP 4 LIST
IF INFORM
THEN OBJ
DROP 2 LIST
'STARTT' STO 2
LIST 'TO' STO
ELSE KILL
END
»
SET$
«
"$ & DRIVE SETUP" {
{ "GAS:"
"PRICE PER GALLON"
} { "EAT:"
"COST PER DAY" } {
"MISC:"
"DAILY MISCELANEOUS COST"
} { "DRIVE:"
"DRIVE TIME PER DAY"
13 } } { 1 4 } { }
GAS$ EAT$ MISC$
DRIVE 4 LIST
IF INFORM
THEN OBJ
DROP 'DRIVE' STO
'MISC$' STO 'EAT$'
STO 'GAS$' STO
ELSE F2T
END
»
SETU
« "UNITS SETUP"
{ { "DIST:" "" 13 }
{ "MPH:" "" 13 } {
"MPG:" "" 13 } {
"TANK:" "" 13 } } {
1 4 } { } DIST RATE
MPG TANK 4 LIST
IF INFORM
THEN OBJ
DROP 'TANK' STO
'MPG' STO 'RATE'
STO 'DIST' STO
ELSE SET$
END
»
SUMMARY
« 2 FIX ERASE {
# 40d # 0d }
"TRIP SUMMARY"
ST2PICT { # 0d # 9d
} "distance: " DIST
N2ST + ST2PICT {
# 0d # 15d }
"time: " DIST RATE
/ UVAL '1_h' UNIT
N2ST + ST2PICT {
# 0d # 21d }
"mph: " RATE N2ST +
ST2PICT { # 0d
# 27d } "mpg: " MPG
N2ST + ST2PICT {
# 0d # 33d }
"gas: " GAS N2ST +
ST2PICT { # 0d
# 39d } "refuel: "
REFUEL + " X" +
ST2PICT { # 0d
# 45d }
"gas price: $ "
GAS$ UVAL + ST2PICT
{ # 0d # 51d }
"DAY COST: $ " EAT$
MISC$ + UVAL +
ST2PICT { # 0d
# 59d }
"TOTAL cost: $ "
COST + ST2PICT {
# 75d # 15d } TO 1
GET ST2PICT { # 81d
# 21d } STARTST 1
12 SUB ST2PICT {
# 81d # 27d }
STARTST 14 22 SUB
ST2PICT { # 75d
# 39d } TO 2 GET
ST2PICT { # 81d
# 45d } ETAST 1 12
SUB ST2PICT { # 81d
# 51d } ETAST 14 22
SUB ST2PICT SEEP
STD
»
COST
« GAS GAS$ *
EAT$ MISC$ + DIST
RATE / '1_d'
CONVERT * + 2 RND
»
ETA
« STARTT 1 GET
DAYS DATE+ STARTT 2
GET DIST RATE /
DRIVE DAYS * - UVAL
HMS+
IF DIST RATE
/ DRIVE / FP 0 ==
THEN DRIVE
UVAL HMS HMS+ SWAP
-1 DATE+ SWAP
END
»
T2F
« TO OBJ DROP
SWAP 2 LIST 'TO'
STO
"Origin & destination
have been switched."
1 DISP 3 FREEZE
»
TO$
« 'EXPN'
"Enter the amount of
money spent:"
"" INPUT OBJ STO+
»
EXPN 372.25
SAVE
« TO DIST RATE
MPG GAS$ EAT$ MISC$
STARTT 8 LIST
JOURN
"Name this trip:" {
ALG Œ "''" 2 }
INPUT OBJ STO
UPDIR
»
N2ST
« "" + DUP SIZE
1 - 2 SWAP SUB
»
ST2PICT
« PICT 3 ROLLD
1 GROB GOR
»
STARTST
« STARTT OBJ
DROP TSTR
»
SEEP
« { # 0d # 0d }
PVIEW 0 WAIT DROP
»
ETAST
« ETA
IF DUP 24 Š
THEN 24 -
SWAP 1 DATE+ SWAP
END TSTR
»
PPAR { (-2,-2)
(2,2) RATE 0 (0,0)
SCATTER Y }
CST { APP SEEP ""
UNITS SAVE JOURN
TO$ EXPN }
END