10 CLEAR ,,1000:CL$=CHR$(26):PRINT CL$:Q$=CHR$(27)+"="
15 PRINT"IFR JET FLIGHT SIMULATOR"
20 PRINT:PRINT"PRESS ANY KEY TO CONTINUE"
25 REM *CREATED BY GENE SZYMANSKI. PUBLISHED IN BYTE, NOV.82
30 REM *OSBORNE VERSION BY R.A. FELDMAN, CHICAGO'S FIRST OSBORNE GROUP, JAN.83
35 REM     *TAKE-OFF MODULE
40 DIM F(9)
45 A$=INKEY$:SS=SS+1:IF A$="" THEN 45
50 RANDOMIZE SS
55 GOTO 80
60 REM    *MOVE TO FLIGHT MODULE AFTER TAKEOFF
65 PRINT CL$;"LOADING THE FLIGHT AND LANDING MODULE"
70 CHAIN "B:JETSIMB"
75 REM    *TAKEOFF MODULE STARTS HERE
80 PRINT CL$:KR=57.2958
85 DIM XM(13),WM(13)
90 DIM P$(31),M$(20)
95 DATA 37,35,32,30,27,25,22,20,17,15,12,10,7,5
100 DATA 6,11,16,21,26,31,36,41,46,51,56,61,66,71
105 FOR I=0 TO 13:READ XM(I):NEXT
110 FOR I=0 TO 13:READ WM(I):NEXT
115 M$=CHR$(152)
120 DIM XE(13),WE(13)
125 K1=29:K2=23
130 FOR I=0 TO 13:XE(I)=K1:WE(I)=K2:K1=K1-2:K2=K2+4:NEXT
135 IO=40:RN=RND(0):RS=1:IF RN<.5 THEN RS=-1
140 W1=75:IF RS=-1 THEN W1=255
145 W2=INT(20*RND(0)+1):W3=RS*W2
150 DIM XL(14),XR(14)
155 J=31:K=49
160 FOR I=0 TO 14:XL(I)=J:XR(I)=K:J=J-2:K=K+2:NEXT
165 DATA FUEL,LBS,%,VHF,MHZ,THRUST,MAX,IDLE,REV
170 DATA PITCH," +"," -",DEG,FLAPS,UP,DWN,WHEELS,UP,MID,DOWN
175 DATA COMPASS,AIRSPEED,KTS," VERT",SPEED,FPM
180 DATA ALTITUDE,FEET,CLOCK,BRAKE,SET,REL
185 FOR I=0 TO 31:READ P$(I):NEXT
190 DIM S$(25)
195 FOR I=1 TO 25:S$(I)=SPACE$(I):NEXT
200 FOR I=0 TO 9:F(I)=0:NEXT
205 REM    *INIT VARIABLES FOR TAKEOFF
210 FU=200000!:FP=0:CC=75:PDQ=0:RC=0:AL=0:TD=28740
215 MZ=77:TR=6:FL=2:FA=0:WH=13:IX=40:HY=8:BR=11:BK=11:AB=0
220 PRINT Q$;CHR$(40);CHR$(40);"UNITED 312     CLEARED AS FILED"
225 PRINT:PRINT:PRINT"SURFACE WINDS VARIABLE, GUSTING TO 15."
230 PRINT"MINIMUM CEILING CONDITIONS ARE IN EFFECT."
235 PRINT"SKY CONDITIONS AT 20,000 ARE SCATTERED."
240 PRINT"               AT 30,000 ARE BROKEN.":PRINT:PRINT
245 PRINT"UPON TAKEOFF, MAINTAIN HEADING OF 075 TO 3,000 THEN PROCEED AS FILED."
250 PRINT:PRINT:PRINT"STANDBY FOR TAKEOFF CLEARANCE."
255 TQ=7000:GOSUB 1315:PRINT CL$
260 PRINT Q$;CHR$(42);CHR$(49);"UNITED 312":PRINT:PRINT
265 PRINT"YOU ARE CLEARED FOR TAKEOFF AT 0800 HOURS"
270 TQ=3000:GOSUB 1315:PRINT CL$:GOSUB 1325:TL=TD
275 GOSUB 305:GOSUB 390
280 GOSUB 445
285 GOSUB 570:K$=INKEY$:IF LEN(K$)=0 GOTO 295
290 GOSUB 735
295 GOTO 950
300 REM    *DISPLAY PANEL HEADERS
305 PRINT Q$;CHR$(32);CHR$(35);P$(0);S$(4);P$(5);S$(3);P$(9);S$(12);P$(20)
310 PRINT Q$;CHR$(42);CHR$(91);P$(13);S$(3);P$(16);S$(2);P$(29)
315 PRINT Q$;CHR$(43);CHR$(93);P$(14);S$(6);P$(14);S$(6);P$(30)
320 PRINT Q$;CHR$(45);CHR$(93);P$(15);S$(5);P$(15);S$(5);P$(31)
325 IF F(9)=1 THEN RETURN
330 PRINT Q$;CHR$(33);CHR$(45);P$(6);S$(6);P$(10);S$(6)
335 PRINT Q$;CHR$(33);CHR$(100);P$(28)
340 PRINT Q$;CHR$(34);CHR$(33);P$(1);S$(4);P$(2);S$(21);S$(3);S$(13);P$(23)
345 PRINT Q$;CHR$(35);CHR$(54);P$(11);S$(13);P$(21);S$(2);P$(24);S$(2);P$(26)
350 PRINT Q$;CHR$(36);CHR$(32);P$(3)
355 PRINT Q$;CHR$(37);CHR$(71);P$(22);S$(6);P$(25);S$(5);P$(27)
360 PRINT Q$;CHR$(38);CHR$(32);P$(4);S$(10);P$(7);S$(3);P$(12);S$(7)
365 PRINT Q$;CHR$(39);CHR$(45);P$(8)
370 FOR Y=1 TO 7:PRINT Q$;CHR$(Y+32);CHR$(44);CHR$(95):NEXT Y
375 FOR Y=1 TO 3:PRINT Q$;CHR$(Y+32);CHR$(53);CHR$(95):NEXT Y
380 RETURN
385 REM    *DISPLAY HORIZONTAL LINE
390 IF F(9)=0 GOTO 405
395 PRINT Q$;CHR$(41);CHR$(32);SPACE$(80);
400 IF HY=20 GOTO 415
405 PRINT Q$;CHR$(HY+32);CHR$(32);STRING$(80,152)
410 RETURN
415 OH=9:HY=9:PRINT Q$;CHR$(40);CHR$(32);SPACE$(80)
420 FOR I=HY TO 21
425 PRINT Q$;CHR$(OH+32);CHR$(32);SPACE$(80)
430 PRINT Q$;CHR$(I+32);CHR$(32);STRING$(80,152)
435 OH=I:NEXT:RETURN
440 REM    *DISPLAY RUNWAY
445 IF F(4)=1 GOTO 485
450 S=10:X=29
455 FOR Y=10 TO 21
460 PRINT Q$;CHR$(Y+32);CHR$(X+32);"*";SPACE$(S);" ";SPACE$(S);"*"
465 X=X-2:S=S+2
470 NEXT Y
475 S$=S$(13):RETURN
480     *PRINT RUNWAY GRAPHICS
485 IF N>3 GOTO 550
490 PRINT Q$;CHR$(OY+32);CHR$(OX+32);SPACE$(WM)
495 PRINT Q$;CHR$(NY+32);CHR$(NX+32);MK$
500 OY=NY:OX=NX:WM=FW
505 RETURN
510    *ENTRY WHEN SHIP IN FINAL ZONE
515 PRINT Q$;CHR$(OY+32);CHR$(OX+32);SPACE$(WM):IF F(9)=1 THEN RETURN
520 FOR I=10 TO NY-1
525 PRINT Q$;CHR$(I+32);CHR$(XE(J)+32);SPACE$(WE(J))
530 NEXT
535 IF N>4 THEN RETURN
540 PRINT Q$;CHR$(NY+32);CHR$(NX+32);MK$
545 RETURN
550 IF F(2)=1 GOTO 515 ELSE F(2)=1
555 FOR I=10 TO 13:PRINT Q$;CHR$(I+32);CHR$(91);SPACE$(21):NEXT
560 GOTO 515
565 REM    *DISPLAY INSTRMT READINGS
570 YP=1:XP=0:F$="######":V1=FU:GOSUB 1360
575 YP=1:XP=7:F$="###":V1=FP:GOSUB 1360
580 YP=1:XP=39:V1=CC:GOSUB 1360
585 YP=4:XP=39:V1=PDQ:GOSUB 1360
590 YP=4:XP=46:F$="######":V1=RC:GOSUB 1360
595 YP=4:XP=55:F$="##,###":V1=AL:GOSUB 1360
600 YP=5:XP=0:F$="###":V1=MZ:GOSUB 1360
605 REM    *DISPLAY THRUST
610 FOR I=1 TO 7
615 PRINT Q$;CHR$(I+32);CHR$(43);CHR$(127)
620 NEXT
625 PRINT Q$;CHR$(TR+32);CHR$(43);">";
630 REM    *DISPLAY PITCH
635 FOR I=1 TO 3:PRINT Q$;CHR$(I+32);CHR$(52);CHR$(127):NEXT
640 PRINT Q$;CHR$(FL+32);CHR$(52);">"
645 F$="+###"
650 YP=5:XP=20:V1=FA:GOSUB 1360
655 REM    *DISPLAY FLAPS
660 IF F(2)=1 GOTO 710
665 FOR I=11 TO 13:PRINT Q$;CHR$(I+32);CHR$(91);CHR$(127):NEXT
670 PRINT Q$;CHR$(BR+32);CHR$(91);">"
675 REM    *DISPLAY WHEELS
680 FOR I=11 TO 13:PRINT Q$;CHR$(I+32);CHR$(99);CHR$(127):NEXT
685 PRINT Q$;CHR$(WH+32);CHR$(99);">"
690 REM    *DISPLAY BRAKES
695 FOR I=11 TO 13:PRINT Q$;CHR$(I+32);CHR$(107);CHR$(127):NEXT
700 PRINT Q$;CHR$(BK+32);CHR$(107);">"
705 REM    *DISPLAY RUNWAY ALIGNMENT INDEX
710 IF F(9)=1 THEN RETURN
715 PRINT Q$;CHR$(55);CHR$(IO+32);" ";
720 PRINT Q$;CHR$(55);CHR$(IX+32);CHR$(141);
725 IO=IX:RETURN
730 REM    *KEY POLL SUBROUTINE
735 IF K$="F" THEN KK=1:GOTO 770
740 IF K$="," OR K$="." THEN KK=2:GOTO 770
745 IF K$="B" THEN KK=3:GOTO 770
750 IF ASC(K$)=10 OR ASC(K$)=11 THEN KK=4:GOTO 770
755 IF K$="L" THEN KK=5:GOTO 770
760 IF K$="W" THEN KK=6:GOTO 770
765 IF K$="S" THEN KK=7:GOTO 770
770 ON KK GOSUB 800,820,845,860,910,935,785
775 RETURN
780 REM    *THRUST KEY (DECREASE)
785 IF F(7)=1 AND BR=11 THEN TR=4
790 RETURN
795 REM    *THRUST KEY (INCREASE)
800 IF F(7)=1 THEN RETURN
805 IF F(0)=0 THEN RETURN
810 F(1)=1:TR=1:RETURN
815 REM    *RUDDER KEYS
820 IF F(7)=1 THEN RETURN
825 IF PDQ<=50 THEN RETURN
830 IF K$="," THEN CC=CC-1 ELSE CC=CC+1
835 RETURN
840 REM    *BRAKES
845 IF F(0)=1 THEN RETURN
850 F(0)=1:BK=13:RETURN
855 REM    *PITCH
860 IF F(7)=1 THEN RETURN
865 IF PDQ<=50 THEN RETURN
870 FD=-10:IF K$=CHR$(10) THEN FD=10
875 FA=FA+FD
880 IF FA>60 THEN FA=60
885 IF FA<-60 THEN FA=-60
890 IF FA>0 THEN FL=1:RETURN
895 IF FA=0 THEN FL=2:RETURN
900 FL=3:RETURN
905 REM    *FLAPS
910 IF F(7)=1 AND WH=11 THEN BR=11:RETURN
915 IF F(3)=1 THEN RETURN
920 IF F(3)=0 THEN F(3)=1:BR=13:RETURN
925 RETURN
930 REM    *WHEELS
935 IF F(7)=1 THEN WH=11
940 RETURN
945 REM    *SITUATION UPDATE ROUTINE
950 GOSUB 1325:TJ=TD-TL:TL=TD
955 IF F(9)=1 GOTO 1380
960 IF F(0)=1 GOTO 970
965 GOSUB 1065:GOTO 285
970 IF F(4)=1 GOTO 980
975 F(4)=1:XX=0:YY=0:TX=TD:V0=0:N=1:OY=22:OX=5:WM=71
980 A=(118-18*TR)*.04028
985 GOSUB 1105
990 IF AL>0 GOTO 1025
995 IF YY>10500 OR ABS(XX)>100 GOTO 1195
1000 IF FA<=0 GOTO 1040
1005 IF PDQ<150 GOTO 1190
1010 IF FA>10 GOTO 1190
1015 IF F(3)=0 GOTO 1040
1020 AL=25:GOSUB 1065:GOSUB 1075:GOSUB 1155:GOTO 280
1025 F(9)=1:GOSUB 1065:GOSUB 1075:GOSUB 1090
1030 FOR I=10 TO 21:PRINT Q$;CHR$(I+32);CHR$(32);SPACE$(80):NEXT
1035 HY=20:GOSUB 390:GOTO 1055
1040 GOSUB 1065:GOSUB 1155
1045 GOTO 280
1050 REM    *NOW DO DEPARTURE PROCEDURES
1055 GOTO 285
1060 REM    *UPDATE FUEL
1065 FU=FU-40*TJ:FP=FU/3120:RETURN
1070 REM    *UPDATE RATE OF CLIMB
1075 RC=PDQ*SIN(ABS(FA/57.3))*1.693*60:IF FA<0 THEN RC=-1*RC
1080 RETURN
1085 REM    *UPDATE ALTITUDE
1090 AL=AL+TJ*RC/60:IF AL<=0 THEN AL=0
1095 RETURN
1100 REM    *EQUATIONS OF MOTION
1105 T=TJ:V=V0+A*T:VB=(V+V0)/2:V0=V:S=VB*T:IF TD<(TX+18) GOTO 1115
1110 TX=TD:WB=RS*RND(2):CC=CC+WB
1115 DA=(CC-75)/57.3:DY=S*COS(ABS(DA)):DX=S*SIN(ABS(DA))
1120 IF DA<0 THEN DX=-1*DX
1125 YY=YY+DY:XX=XX+DX:PDQ=V/1.69278:IF PDQ>20 THEN PDQ=PDQ+WS
1130 IX=40+FIX(XX*7/20):IF IX>79 THEN IX=79
1135 IF IX<0 THEN IX=0
1140 ZP=FIX(YY-2500*(N-1)):IF ZP>2500 THEN N=N+1:GOTO 1140
1145 RETURN
1150 REM    *VARIABLES FOR RUNWAY GRAPHICS
1155 MP=FIX(10+(13*ZP)/2500):IF N>3 THEN GOTO 1180
1160 NY=MP:J=NY-10:NX=XM(J):FW=WM(J):S$=SPACE$(J)
1165 MK$=M$+S$(J)+M$+S$(J)+M$+S$(J)+M$+S$(J)+M$+S$(J)+M$
1170 RETURN
1175 REM    *IN ZONE 4 MARKER IS RUNWAY EDGE
1180 NY=MP:J=NY-10:NX=XE(J):IF N>4 THEN RETURN
1185 MK$=STRING$(WE(J),152):RETURN
1190 AB=1:GOTO 1215
1195 AB=2:IF YY<10500 GOTO 1215
1200 FOR I=10 TO 21:PRINT Q$;CHR$(I+32);CHR$(32);SPACE$(80):NEXT
1205 GOTO 1215
1210 REM    *ABORT TAKEOFF
1215 FOR I=10 TO 22:PRINT Q$;CHR$(I+32);CHR$(32);SPACE$(80):NEXT
1220 PRINT Q$;CHR$(42);CHR$(61);"TAKEOFF FAILED":PRINT:PRINT
1225 ON AB GOSUB 1240,1260
1230 PRINT Q$;CHR$(51);CHR$(66);"END OF PROGRAM"
1235 END
1240 PRINT"YOU PULLED BACK ON THE STICK AT TOO SLOW A SPEED, OR YOU"
1245 PRINT"PULLED BACK THE STICK TOO FAR WHEN AT PROPER SPEED."
1250 PRINT"AS A RESULT THE TAIL END OF THE FUSELAGE SCRAPED THE RUNWAY"
1255 PRINT"AND THE AIRCRAFT SPUN OUT OF CONTROL.":RETURN
1260 IF YY>10500 GOTO 1280
1265 PRINT"YOU FAILED TO STAY WITHIN THE RUNWAY BOUNDRIES."
1270 PRINT"AS A RESULT YOU VEERED OFF THE RUNWAY AND COLLIDED WITH"
1275 PRINT"THE RUNWAY LIGHTS.":RETURN
1280 PRINT"YOU RAN OUT OF RUNWAY. AS A RESULT YOU ROLLED INTO THE"
1285 PRINT"MARSHLANDS LOCATED";FIX(YY)-10500;"FEET PAST THE END OF THE RUNWAY."
1290 IF F(3)=1 THEN RETURN
1295 PRINT:PRINT:PRINT"YOU FORGOT TO LOWER THE FLAPS."
1300 PRINT"AS A RESULT THE AIRCRAFT COULD NOT DEVELOP SUFFICIENT LIFT."
1305 RETURN
1310 REM    *TIME DELAY PAD
1315 FOR I=1 TO TQ:NEXT:RETURN
1320 REM    *CLOCK UPDATE
1325 HRS=FIX(TD/3600):MIN=FIX((TD-3600*HRS)/60):SEC=TD-(3600*HRS+60*MIN)
1330 TD=TD+1
1335 YP=0:XP=66:F$="##.":V1=HRS:GOSUB 1360
1340 YP=0:XP=69:F$="##.":V1=MIN:GOSUB 1360
1345 YP=0:XP=72:F$="##":V1=SEC:GOSUB 1360
1350 RETURN
1355 REM    *PLOT VARIABLE
1360 PRINT Q$;CHR$(YP+32);CHR$(XP+32);
1365 PRINT USING F$;V1
1370 RETURN
1375 REM    *DEPARTURE ROUTINE
1380 IF F(7)=1 GOTO 1390 ELSE F(7)=1
1385 GOSUB 310:F(2)=0
1390 IF WH<>11 GOTO 1405 ELSE PDQ=PDQ+5
1395 IF BR<>11 GOTO 1405 ELSE PDQ=PDQ+5
1400 IF TR=4 AND AL>1800 GOTO 65 ELSE GOTO 1440
1405 IF AL<1200 GOTO 1440
1410 PRINT Q$;CHR$(44);CHR$(32);"FLIGHT ABORTED":PRINT:PRINT
1415 PRINT"YOU FAILED TO PERFORM CRUCIAL TRIM MANEUVERS FOLLOWING LIFTOFF."
1420 PRINT"THE PROPER TRIM SEQUENCE, WHICH MUST BE COMPLETED BELOW 1200 FEET, IS"
1425 PRINT"1- RAISE LANDING GEAR":PRINT"2- RETRACT FLAPS"
1430 PRINT"3- REDUCE THRUST":PRINT:PRINT"END OF PROGRAM"
1435 END
1440 GOSUB 1065:GOSUB 1075:GOSUB 1090:GOTO 285
1445 REM    *END OF LISTING
CE THRUST":PRINT:PRINT"ND OF PROGRAM"
1435 END
1440 GOSUB 1065:GOSUB 1075:GOSUB 1090:GOTO 285
144u REM    *END OF LISTI