home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d150
/
dc10.lha
/
DC10
/
DC10.bas
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
1987-06-15
|
8KB
|
147 lines
REM * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
REM * DC-10 Flightsimulation ( part 1 ), by Jan Arkesteijn, <C> 1988 *
REM * V 0.1f released in the public domain 9 april 1988, see doc file *
REM * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
start:
CLS : PALETTE 0,0,0,0:PALETTE 1,0,0.75,0
LOCATE 4,28 : PRINT"* * * D C 1 0 * * *"
LOCATE 6,28 : PRINT" by "
LOCATE 8,28 : PRINT" JAN ARKESTEIJN "
LOCATE 10,28 : PRINT" <C> 1988 "
LOCATE 15,28 : PRINT" - OPTIONS - "
LOCATE 17,28 : PRINT"<1> Making a Flightplan"
LOCATE 18,28 : PRINT"<2> Take-off and fly "
LOCATE 19,28 : PRINT"<3> Practice landings "
LOCATE 21,28 : INPUT"Enter your choice (1,2,3)";a
IF a<1 OR a>3 THEN start
IF a=2 THEN RUN"dc10eur.bas"
IF a=3 THEN RUN"dc10mia.bas"
fp:
CLEAR 2500 : DIM l$(90),C(10),c1(10),C$(11),d1(10),d2(10)
l$( 1)="BCN:51.7233:-3.26167:8.2" : l$( 2)="BIG:51.3300:+0.03667:6.6"
l$( 3)="BNN:51.7250:-0.54833:7.0" : l$( 4)="BUR:51.5167:-0.66833:7.1"
l$( 5)="BTN:53.4583:-2.45500:7.8" : l$( 6)="CFD:52.0733:-0.61000:7.1"
l$( 7)="CLN:51.8483:+1.15000:5.8" : l$( 8)="DET:51.3033:+0.59833:6.2"
l$( 9)="DTY:52.1800:-1.11167:7.3" : l$(10)="DVR:51.1617:+1.35667:5.7"
l$(11)="GAM:53.2817:-0.94500:7.3" : l$(12)="HON:52.3583:-1.65833:7.4"
l$(13)="IBY:50.8933:-1.74833:7.4" : l$(14)="LAM:51.6450:+0.15333:6.3"
l$(15)="LON:51.4867:-0.46500:7.0" : l$(16)="MAY:51.0167:+0.11833:6.5"
l$(17)="MID:51.0533:-0.62333:7.0" : l$(18)="OCK:51.3050:-0.44500:6.9"
l$(19)="SFD:50.7600:+0.12333:6.4" : l$(20)="WAL:53.3917:-3.13333:8.0"
l$(21)="BPK:51.7483:-0.10167:6.7" : l$(22)="CAM:52.2100:+0.18500:6.3"
l$(23)="CON:53.1967:-2.19333:7.7" : l$(24)="DUN:51.1317:-0.38167:6.8"
l$(25)="KNI:52.5400:-3.22667:8.1" : l$(26)=" LA:51.5067:-2.00500:7.5"
l$(27)="LIC:52.7467:-1.71667:7.4" : l$(28)="MCR:53.3300:-2.32667:7.7"
l$(29)=" NH:52.6767:+1.38667:5.8" : l$(30)="WOD:51.4533:-0.87833:7.3"
l$(31)="EEL:53.1650:+6.66722:3.3" : l$(32)="HDR:52.9081:+4.76611:3.9"
l$(33)="HSD:51.7236:+3.85833:4.4" : l$(34)="MAS:50.9728:+5.96083:3.4"
l$(35)="PAM:52.3358:+5.09250:3.7" : l$(36)="RKN:52.1342:+6.76444:3.0"
l$(37)="RTM:51.9747:+4.48139:4.1" : l$(38)="SPL:52.2847:+4.75583:3.9"
l$(39)="SPY:52.5414:+4.85417:3.9"
l$(41)="EHN:51.4756:+5.59056:3.6" : l$(42)="ENK:52.6742:+5.24139:3.7"
l$(43)="LAK:52.5122:+5.56944:3.6" : l$(44)="NYK:52.2319:+5.52611:3.6"
l$(45)="ROT:51.8986:+4.55472:4.1" : l$(46)="STD:51.7422:+4.24389:4.3"
l$(47)="THN:51.1842:+5.83389:3.5" : l$(48)="DEN:50.8823:+4.03077:4.3"
l$(49)="GAA:50.7783:+4.62833:4.0" : l$(50)="ONT:51.2150:+5.55833:3.6"
l$(51)="BUB:50.9017:+4.53667:3.9" : l$(52)="BUN:51.0767:+4.77333:4.0"
l$(53)="CIV:50.5750:+3.83333:4.6" : l$(54)="COA:51.3483:+3.35500:4.6"
l$(55)="KOK:51.0950:+2.65333:4.8" : l$(56)="LNO:50.5867:+5.71139:3.5"
l$(57)="NIK:51.1658:+4.18528:4.3" : l$(58)="SPI:50.5150:+5.62500:3.5"
l$(61)=" OA:52.4714:+4.75361:3.9" : l$(63)=" WP:52.3272:+5.03333:3.8"
l$(64)=" GX:52.5183:-1.82000:7.4" : l$(66)=" GY:51.1270:-0.31200:6.8"
l$(69)=" NW:51.0203:+5.87889:3.5" : l$(70)=" RR:52.0053:+4.76944:4.0"
l$(71)="ASD:52.3297:+4.74250:3.9" : l$(72)="ASD:52.3054:+4.77387:3.9"
l$(73)="ASD:52.3206:+4.79278:3.9" : l$(74)="BMH:52.4609:-1.75566:7.4"
l$(75)="BXL:50.8951:+4.50772:4.0" : l$(76)="LGW:51.1415:-0.20190:6.8"
l$(77)="LHR:51.4686:-0.48000:7.0" : l$(78)="MCR:53.3484:-2.28823:7.7"
l$(79)="MST:50.9214:+5.77583:4.1" : l$(80)="RTD:51.9622:+4.44861:4.1"
CLS : cr=0.0174533 : ck=60/cr : e0=9e-06 : e1=1854*e0
PRINT:PRINT" Survey of available radiobeacons and runways" : PRINT : PRINT
PRINT" GB-VOR GB-VOR GB-NDB NL-VOR NL/B-NDB B-VOR LOC RWY" : PRINT
PRINT" 1:BCN 11:GAM 21:BPK 31:EEL 41:EHN 51:BUB 61:OA 71:ASD 19R"
PRINT" 2:BIG 12:HON 22:CAM 32:HDR 42:ENK 52:BUN 72:ASD 24 "
PRINT" 3:BNN 13:IBY 23:CON 33:HSD 43:LAK 53:CIV 63:WP 73:ASD 27 "
PRINT" 4:BUR 14:LAM 24:DUN 34:MAS 44:NYK 54:COA 64:GX 74:BMH 15 "
PRINT" 5:BTN 15:LON 25:KNI 35:PAM 45:ROT 55:KOK 75:BXL 25L"
PRINT" 6:CFD 16:MAY 26: LA 36:RKN 46:STD 56:LNO 66:GY 76:LGW 08 "
PRINT" 7:CLN 17:MID 27:LIC 37:RTM 47:THN 57:NIK 77:LHR 10R"
PRINT" 8:DET 18:OCK 28:MCR 38:SPL 48:DEN 58:SPI 78:MCR 06 "
PRINT" 9:DTY 19:SFD 29: NH 39:SPY 49:GAA 69:NW 79:MST 22 "
PRINT" 10:DVR 20:WAL 30:WOD 50:ONT 70:RR 80:RTD 24 "
PRINT:PRINT" Compose your flightplan hopping from beacon to beacon/waypoint"
PRINT" Enter the appropriate numbers (max 10) separated by a > sign"
PRINT" Example 12>37@147>3"
nr$="" : PRINT : INPUT nr$
IF RIGHT$(nr$,1) <> ">" THEN nr$=nr$+">"
IF LEN(nr$)<4 THEN fp
FOR x=1 TO LEN(nr$)
IF MID$(nr$,x,1)=">" THEN
n=n+1 : c1(n)=x : C$(n)= MID$(nr$,c1(n-1)+1,c1(n)-c1(n-1)-1)
ELSE
GOTO jp1
END IF
IF LEN(C$(n))<3 AND VAL(C$(n))>80 GOTO fp
IF LEN(C$(n))<3 AND VAL(C$(n))<=80 THEN IF l$(VAL(C$(n)))="" GOTO fp
IF LEN(C$(1))>2 OR C$(n)=C$(n+1) GOTO fp
IF LEN(C$(n))<3 THEN
C(n)=VAL(C$(n)) : GOTO jp1
ELSEIF LEN(C$(n))>4 THEN
d1(n)=VAL(LEFT$(C$(n),3)):d2(n)=VAL(RIGHT$(C$(n),3))-VAL(RIGHT$(l$(C(n-1)),3))
d2(n)=d2(n)-(d2(n)<0)*360
ELSE
GOTO fp
END IF
IF d1(n)<0.1 OR d1(n)>99 GOTO fp
IF d2(n)<0 OR d2(n)>360 GOTO fp
f=0
FOR y=1 TO LEN(C$(n))
IF MID$(C$(n),y,1)="@" THEN f=1 : IF LEN(C$(n))-y<>3 GOTO fp
NEXT y
IF f<>1 GOTO fp
fx=VAL(MID$(l$(C(n-1)),5,7))+d1(n)*COS(d2(n)*cr)*e1
fx$=LEFT$(STR$(fx),8) : fx$=fx$+STRING$(8-LEN(fx$),"0")
fy=VAL(MID$(l$(C(n-1)),13,8))+d1(n)*SIN(d2(n)*cr)*e1/COS(fx*cr)
IF ABS(fy)<1 THEN fz=fy+(fy<0)-(fy>0):fy$=STR$(fz):POKE SADD(fy$)+1,48
IF ABS(fy)>=1 THEN fy$=STR$(fy)
fy$=LEFT$(fy$,8) : fy$=fy$+STRING$(8-LEN(fy$),"0")
IF fy>9.99 OR fy<-6.8 GOTO fp
C(n)=80+n : w$="WP"+RIGHT$(STR$(n),1)
l$(C(n))=w$+":"+RIGHT$(fx$,7)+":"+fy$+":"+MID$(STR$(6.5-0.5*fy),2,3)
jp1:
NEXT x
n1=n : b$=LEFT$(l$(C(1)),3) : e$=LEFT$(l$(C(n)),3)
CLS : LOCATE 8,20 : PRINT"Result also to printer (y/n) ?"
key1:
i$=INKEY$ : IF i$="" GOTO key1
IF i$ ="y" THEN p=1 : LPRINT" " : LPRINT"FLIGHTPLAN ";b$;" - ";e$ : LPRINT" "
CLS : LOCATE 3,25 : PRINT"FLIGHTPLAN ";b$;" - ";e$
LOCATE 6,22 : PRINT"From To d (nm) QDM (degr)"
IF p=1 THEN LPRINT"From To d (nm) QDM (degr)" : LPRINT" "
FOR x=1 TO n1-1
l1$=LEFT$(l$(C(x)),3) : l2$=LEFT$(l$(C(x+1)),3)
by=VAL(MID$(l$(C(x)),5,7)) : bx=VAL(MID$(l$(C(x+1)),5,7))
ly=VAL(MID$(l$(C(x)),13,8)) : lx=VAL(MID$(l$(C(x+1)),13,8))
m1=VAL(RIGHT$(l$(C(x)),3))
lm=0.5*cr*(lx-ly) : bm=0.5*cr*(bx-by) : bp=0.5*cr*(bx+by)
gm=ATN(SIN(bm)/(COS(bp)*TAN(lm)))
gp=ATN(COS(bm)/(SIN(bp)*TAN(lm)))
dg=2*ATN((SIN(gp)/SIN(gm))*TAN(bm))*ck : dt=dt+dg
ri=(gp-gm)/cr+m1 : ri=ri-(ri<0)*360
ri$=RIGHT$(STR$(1000+INT(ri+0.5)),3)
IF dg<9.95 THEN puss$=" #.#" :ELSE puss$="### "
pu$="\ \ \ \ "+puss$+" \ \"
LOCATE 7+x,22 : PRINT USING pu$;l1$;l2$;dg;ri$
IF p=1 THEN LPRINT USING pu$;l1$;l2$;dg;ri$
NEXT x
LOCATE x+7,37 : PRINT"______"
LOCATE x+9,22:PRINT USING"Total distance ####";dt
IF p=1 THEN LPRINT" ------"
IF p=1 THEN LPRINT USING"Total distance ####";dt
LOCATE 22,17 : PRINT"Do you want to change your routeplan (y/n) ?"
key2:
i$=INKEY$ : IF i$="" GOTO key2
IF i$="y" THEN GOTO fp :ELSE RUN"dc10eur.bas"