-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDISTANCE_EL(OEM737).BAS
More file actions
198 lines (160 loc) · 5.21 KB
/
Copy pathDISTANCE_EL(OEM737).BAS
File metadata and controls
198 lines (160 loc) · 5.21 KB
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
'* Žƒˆ‰„‘ •ˆŠˆŽ‹„’ˆ‰„‘ €Ž‘’€‘„ˆ‘ ŽŠ„—Œ †„ˆ—’ˆ‰†‘ „ŠŠ€ƒŽ‘
'* ver 1.0 **** 1991-12-03 + €¨® ¡ã â¡›¦©ž š ˜ «¦ PC-MASTER (ઠAgrinio Club)
'* ver 1.1 **** 1996-11-23 + €¢¢˜šâª ©«˜ ®¨é£˜«˜
' | ¦ œ¬˜¤áš¤à©«¦ source
' | ¨¦©Ÿã¡ž £ž¤ç£˜«¦ª ©«ž¤ ⥦›¦
' | ¨¦©Ÿã¡ž ˜¨ Ÿ£¦ç â¡›¦©žª ©«¦¤ «å«¢¦
' + 矣 ©ž £œ«˜š¢é« ©žª š ˜ 8086 ®à¨åª 8087
'* ver 1.2 **** 2019-03-04 + ‰˜Ÿá¨ ©£˜ §¨¦ª ˜¨®œ ¦Ÿâ«ž©ž ©«¦ Github
'* (C)opyright 1991-2019 ‚ 騚¦ª ‹§ ¨£§å¢žª - Zoomicon
$CPU 8086
$float EMULATE
$option CNTLBREAK OFF
ON KEY(1)GOSUB Telos:KEY(1)ON
START:
SCREEN 0,0,0:WIDTH 80:COLOR 7,0:CLS
COLOR 7,7:LOCATE 25,1:?SPC(79)
color 7,4:locate 25,2:?"F1";
LOCATE 25,21:?" "CHR$(24)SPC(7)CHR$(25)SPC(7)CHR$(27)SPC(11)CHR$(26);
LOCATE 25,66:?"ENTER";
COLOR 0,7:LOCATE 25,4:?"-„¥¦›¦ª ";:locate 25,71:?"-„§ ¢¦šã ";
locate 25,23:?"-á¤à ";:locate 25,31:?"-‰á«à ";:locate 25,39:?"-€¨ ©«œ¨á ";:LOCATE 25,51:?"-ƒœ¥ á";
LOCATE 17,2:color 7,0
?"‚ ˜ ¤˜ ™¨œå«œ «ž¤ ˜§æ©«˜©ž £œ«˜¥ç ›ç¦ §æ¢œà¤ «¦§¦Ÿœ«ã©«œ «ž ૜ ¤ã £§á¨˜"
?"©«ž¤ §¨é«ž §æ¢ž ¡˜ §˜«ã©«œ «¦ ENTER. ‰á¤œ«œ «¦ å› ¦ £œ «ž ›œç«œ¨ž §æ¢ž.
?"’¦ §¨æš¨˜££˜ Ÿ˜ ©˜ª ›é©œ «ž¤ ¦› ¡ã ˜§æ©«˜©ž £œ«˜¥ç «à¤ ›ç¦ §æ¢œà¤ ¡˜ Ÿ˜ ©˜ª"
?"ž«ã©œ «ž¤ £â©ž «˜®ç«ž«˜ £œ «ž¤ ¦§¦å˜ Ÿ˜ › ˜¤ç©«œ «ž¤ ˜§æ©«˜©ž. €¤ ›é©œ«œ £ ˜"
?"£â©ž «˜®ç«ž«˜ «æ«œ «¦ §¨æš¨˜££˜ Ÿ˜ ©˜ª ›é©œ «¦ £â©¦ ®¨æ¤¦ £â©˜ ©«¦¤ ¦§¦å¦ Ÿ˜"
?"› ˜¤ç©œ«œ «ž¤ ¦› ¡ã ˜§æ©«˜©ž £œ«˜¥ç «à¤ ›ç¦ §æ¢œà¤."
color 0,1:locate 24,1:?spc(79):locate 24,13:color 7,1:?"Copyright 1991-2019 ‚ 騚¦ª ‹§ ¨£§å¢žª / Agrinio Club";
locate 1,1:color 0,7:?SPC(7)"Žƒˆ‰„‘ •ˆŠˆŽ‹„’ˆ‰„‘ €Ž‘’€‘„ˆ‘ ŽŠ„—Œ †„ˆ—’ˆ‰†‘ „ŠŠ€ƒŽ‘ (# 1.2)"spc(7);
'-------------------------
color 7,0
OPEN "I",#2,"CITIES.DAT"
FOR D%=1 TO 13
INPUT #2,CIT$
LOCATE D%+2,2:IF D%<10 THEN ?D%" "CIT$ ELSE ?D%" "CIT$
NEXT D%
FOR D%=1 TO 13
INPUT #2,CIT$
LOCATE D%+2,29:?D%+13" "CIT$
NEXT D%
FOR D%=1 TO 13
INPUT #2,CIT$
LOCATE D%+2,56:?D%+26" "CIT$
NEXT D%
CLOSE #2
'-------------------------
call menu(3,3,19,1,15,7,ch1$)
a%=val(left$(ch1$,2))
10 call menu(3,3,19,1,15,7,ch2$)
b%=val(left$(ch2$,2))
if a%=b% then 10
'-------------------------
open "i",1,"DISTANCE.DAT"
if b%<a% then swap a%,b%
for t%=2 to b%-1
line input #1,a$
next t%
for t%=1 to a%
input #1,b%
next t%
close #1
'-------------------------
s1%=instr(5,ch1$," "):s2%=instr(5,ch2$," ")
call wind(1,1,218,191,23,79,217,192,196,179, 1,7)
color 1,7:LOCATE 3,12
?"† ˜§æ©«˜©ž "mid$(ch1$,5,s1%-5)" - "mid$(ch2$,5,s2%-5)" œå¤˜ ";
color 20,7:?b%;:color 1,7:?"km"
3 color 15,9:locate 5,3:?"ƒé©«œ £¦¬ «ž £â©ž «˜®ç«ž«˜ £œ «ž¤ ¦§¦å˜ Ÿ˜ › ˜¤ç©œ«œ «ž¤ ˜§æ©«˜©ž "spc(5)"km/h"
color 31,1:locate 5,69:call getname(tax$,4):tax=val(tax$):if tax=0 then 3
color 1,15:hrs=b%/tax:locate 8,15:?"‡˜ › ˜¤ç©œ«œ «ž¤ ˜§æ©«˜©ž ©œ ";:color 8,15:?hrs;:color 1,15
if hrs<>1 then ?" 騜ª" else ?" 騘 "
LOCATE 21,23:?"‡â¢œ«œ ¤˜ ¥˜¤˜›¦¡ £á©œ«œ (Œ/Ž) ;";:ans$=INPUT$(1)
LOCATE 21,55:if instr("NnŒ¤",ans$) THEN ?"Œ€ˆ":GOTO START
?"Ž•ˆ"
Telos:
COLOR 7,0:CLS
?"ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"
?"³ Žƒˆ‰„‘ •ˆŠˆŽ‹„’ˆ‰„‘ €Ž‘’€‘„ˆ‘ ³"
?"³ ŽŠ„—Œ †„ˆ—’ˆ‰†‘ „ŠŠ€ƒŽ‘ #1.2 ³"
?"ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´"
?"³ ‚. ‹§ ¨£§å¢žª ³"
?"ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"
END
'-------------------------------------------------------------------
sub menu(ilx%,ily%,ox%,fgr%,bgr%,space%,choice$)
o$=chr$(0)
BILX=ILX:BILY=ILY
cv=0
goto fcr
'**** controls ****
red:
k$=inkey$
select case k$
case "8",o$+"H"
bily%=ily%:bilx%=ilx%:ily%=ily%-1:goto fcr
case "2",o$+"P"
bily%=ily%:bilx%=ilx%:ily%=ily%+1:goto fcr
case "4",o$+"K"
bily%=ily%:bilx%=ilx%:ilx%=ilx%-ox%-space%-1:goto fcr
case "6",o$+"M"
bily%=ily%:bilx%=ilx%:ilx%=ilx%+ox%+space%+1:goto fcr
case chr$(13)
locate ily%,ilx%:color 7,0:?choice$;
color 3,0:?chr$(27)chr$(205) '©ž£œåੜ œ§ ¢¦šã
exit sub
case else
goto red
end select
fcr:
if ily%<1 then ily%=bily%:goto red
if ilx%<1 then ilx%=bilx%:goto red
if ilx%>79-ox% then ilx%=bilx%:goto red
ccr=screen(ily%,ilx%)
if ccr=32 then ily%=bily%:ilx%=bilx%:goto red
if cv=0 then cat
locate bily%,bilx%:color 7,0:?choice$
cat:
cv=1
choice$=""
k%=0
for ix%=ilx% to ilx%+ox%-1
c%=screen(ily%,ix%)
choice$=choice$+chr$(c%)
next ix%
locate ily%,ilx%:color fgr%,bgr%:?choice$
goto red
end sub
'----------------------------------------------------------------------
'† ¬§¦¨¦¬«å¤˜ ˜¬«ã ›ž£ ¦¬¨šœå ⤘ §˜¨áŸ¬¨¦ ©«ž¤ ¦Ÿæ¤ž
sub wind(x1%,y1%,a,a1,x2,y2%,b,b1,c,d,fgr%,bgr%)
color fgr%,bgr%
locate x1%,y1%:?chr$(a):locate x2,y2%:?chr$(b)
locate x1%,y2%:?chr$(a1):locate x2,y1%:?chr$(b1)
k$=string$(y2%-y1%-1,c):locate x1%,y1%+1:?k$:locate x2,y1%+1:?k$
for s%=x1%+1 to x2-1
locate s%,y1%:?chr$(d);spc(y2%-y1%-1);chr$(d)
next s%
end sub
'† ¬§¦¨¦¬«å¤˜ ˜¬«ã ›â®œ«˜ ⤘ 椦£˜ ˜§¦ «¦ §¢ž¡«¨¦¢æš ¦
sub getname(nam$,lim)
nam$="":y=pos(0):x=csrlin:?string$(lim,95):locate x,y:f=1
while f<lim+1
2 d$=input$(1)
select case d$
case chr$(13)
delay .5:exit sub
case chr$(9)
goto 2
case chr$(8)
f=f-1:if f=0 then f=f+1:goto 2
nam$=left$(nam$,f-1):y=pos(0):x=csrlin:locate x,y-f:?STRING$(lim,95);:locate x,y-f:?nam$;:goto 2
case else
IF ASC(D$)>47 AND ASC(D$)<58 THEN ?d$; ELSE 2
nam$=nam$+d$:f=f+1
end select
wend
delay .5
end sub