home *** CD-ROM | disk | FTP | other *** search
- M=0
- N=0
- DIM X(10),Y(10),DI(20)
- 6 PRINT "PLEASE ENTER DISTANCE NUMBER :(MAX VAL IS 11)"
- LPRINT"PLEASE ENTER DISTANCE NUMBER :(MAX VAL IS 11)"
- INPUT NN :NN=NN+1
- LPRINT NN-1
- 10 ON ERROR GOTO 1000
- 20 OPEN"com1:300,n,8,2,ds0,cs0,rs"AS#1
- A$=INPUT$(13,#1)
- FOR I=1 TO 13
- C=ASC(MID$(A$,I,1))
- IF C>127 THEN C=C-128
- C$=C$+CHR$(C)
- NEXT I
- N=N+1
- X(N)=VAL(MID$(C$,M+2,6))/1000.000:Y(N)=VAL(MID$(C$,M+8,6))/1000.000
- LPRINT "x(";N;")=";using "##.###";X(N);:lprint" y(";N;")=";using "##.###";Y(N)
- PRINT"x(";N;")=";using "##.###";X(N);:print" y(";N;")=";using "##.###";Y(N)
- M=M+13
- IF N<2 THEN : CLOSE:GOTO 20
- D=(X(N)-X(N-1))^2+(Y(N)-Y(N-1))^2:DI(N-1)=SQR(D)
- PRINT " distance : "using "##.####";DI(N-1)
- LPRINT " distance : ";using "##.####";DI(N-1)
- IF N<NN THEN CLOSE:GOTO 20
- PRINT "DO YOU NEED CALCULATE AVERAGE DISTANCE ENTER (Y/N)?"
- LPRINT "DO YOU NEED CALCULATE AVERAGE DISTANCE ENTER (Y/N)?"
- B$=INPUT$(1)
- IF B$="n" THEN CLS:GOTO 300
- FOR K=1 TO NN
- T=T+DI(K)
- NEXT K
- TT=T/(NN-1)
- PRINT "AVERAGE DISTANCE=";USING "##.####";TT
- LPRINT"AVERAGE DISTANCE=";USING "##.####";TT
- FOR J=1 TO NN-1
- DI(J)=DI(J)-TT
- NEXT J
- FOR F=1 TO NN-1
- PRINT" DI(";F;")=";USING "##.####";DI(F)
- LPRINT " DI(";F;")=";USING "##.####";DI(F)
- NEXT F
- 300 CLEAR:GOTO 6
- 1000 PRINT ERR,ERL: LPRINT ERR,ERL:RESUME 20