home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hacker Chronicles 2
/
HACKER2.BIN
/
783.QTHSORT.2
< prev
next >
Wrap
Text File
|
1985-09-28
|
1KB
|
39 lines
10 REM QTHSORT
20 REM by Joe Kasser G3ZCZ 1979
30 N = 100
40 DIM C1$((N*10)+10),L2(N),A2(N)
50 F$ = "QTHDATA" \ OPEN#1,F$
60 PRINT#Z1 " CITY LATITUDE LONGITUDE (E)"
70 FOR I = 1 TO N
80 READ#1,C$,A,L1
90 C1$(I*10,(I*10)+10)=C$
100 L2(I)=L1
110 A2(I)=A
120 IF C$(1,1) = "*" THEN EXIT 170
130 C$=C$+" "
140 PRINT#Z1 C$,%10F2,ABS(A),\IF A<0 THEN PRINT#Z1, " S", ELSE PRINT#Z1, " N",
150 IF L1 < 0 THEN PRINT#Z1 %10F2, 360 + L1 ELSE PRINT#Z1 %10F2,L1
160 NEXT
170 I = I - 2 \ REM IGNORE * ENTRY
180 X = 0
190 FOR J = 1 TO I
200 J$ = C1$(J*10,(J*10)+10)
210 K$ = C1$((J+1)*10,((J+1)*10)+10)
220 IF J$ =< K$ THEN 300
230 I$=K$
240 C1$((J+1)*10,((J+1)*10)+10) = J$
250 A5 = A2(J+1) \ A2(J+1) = A2(J) \ A2(J) = A5
260 A5 = L2(J+1) \ L2(J+1) = L2(J) \ L2(J) = A5
270 C1$(J*10,(J*10)+10) = I$
280 PRINT K$,J$
290 X = 1
300 NEXT
310 IF X = 1 THEN 180
320 OPEN #2,F$
330 FOR J = 1 TO I + 1
340 PRINT#Z1, C1$(J*10,(J*10)+9),%10F2,A2(J),%10F2,L2(J)
350 WRITE#2, C1$(J*10,(J*10)+10),A2(J),L2(J)
360 NEXT
370 WRITE#2,"*",0,0
380 CLOSE#2 \ CLOSE#1