30152 DIM PL(7,1):P=TJ#*(TJ#*.0003011#+149474.07078#)+178.179078#:GOSUB 16400:PL=P*RF:PA=.3870986#:PE=TJ#*(TJ#*(-.00000003#)+.00002046#)+.20561421#:PII=(TJ#*(TJ#*(-.0000183#)+.0018608#)+7.002881#)*RF:PO=(TJ#*(TJ#*.0001739#+1.1852083#)+47.145944#)*RF
30157 IF FI=0 THEN TD=COS(XLAM-SLED)*COS(XB):TN=SQR(1-TD*TD):GOSUB 16300:T=PI#-T-.00256214328#*(1#-.0549*SIN(TMPU))*TN/(1#-.0167*SIN(SMA)):FI=(.5+COS(T)/2)*100
30160 RA=SUNRA:DEC=SUNDEC:GOSUB 20000:KN=3:JY=17:GOSUB 30465:IF Z<>0 THEN PUT(X-5,Y-5),SU%,OR
30165 P=TJ#*(TJ#*.000007#+149472.51529#)+102.27938#:GOSUB 16400:PM=P*RF:JY=19:KN=1:GOSUB 30450:IF Z<>0 THEN PUT(X-2,Y-4),S1%,OR
31015 LOCATE 24,12:COLOR IGR:PRINT"Press the ";:COLOR IBW:PRINT"ENTER";:COLOR IGR:PRINT" key";:LOCATE 25,12:PRINT"when you are finished.";:K=0:IBL=IYL+8:GOTO 31021
31018 PRINT OB$(K):K=(K+1) MOD 14
31021 IY=VAL(LEFT$(OBB$(K),2)):IX=VAL(RIGHT$(OBB$(K),2)):LOCATE IY,IX:COLOR IBL:PRINT OB$(K):COLOR IYL:LOCATE 13,9:IF K=6 THEN PRINT"+ or -"; ELSE PRINT STRING$(6,32)
31022 LOCATE 20,9:IF K=13 THEN PRINT"1950 or 2000"ELSE PRINT STRING$(12,32)
31023 LOCATE IY,IX
31024 A$=INKEY$:IF A$=""THEN 31024
31027 IF A$=CHR$(27) THEN 4000
31030 IF A$=CHR$(13) THEN 31060
31033 IF LEN(A$)=2 THEN BA$=RIGHT$(A$,1) ELSE BA$="A"
31036 IF BA$=CHR$(77) THEN 31018
31039 IF BA$=CHR$(75) THEN PRINT OB$(K):K=(K+13) MOD 14:GOTO 31021
31042 IF BA$=CHR$(72) AND K>5 THEN PRINT OB$(K):IF K<8 THEN K=K-6:GOTO 31021 ELSE IF K<12 THEN K=K-7:GOTO 31021 ELSE IF K=13 THEN K=6:GOTO 31021 ELSE K=K-8:GOTO 31021
31045 IF BA$=CHR$(80) AND K<13 THEN PRINT OB$(K):IF K=4 THEN K=12:GOTO 31021 ELSE IF K<2 THEN K=K+6:GOTO 31021 ELSE IF K>5 THEN K=13:GOTO 31021 ELSE K=K+7:GOTO 31021
31048 IF A$=CHR$(8) THEN PRINT OB$(K):K=(K+13)MOD 14:GOTO 31021
31051 IF K=6 THEN IF A$<>"-" THEN OB$(K)="+":GOTO 31018 ELSE OB$(K)="-":GOTO 31018
31052 IF K=13 THEN IF A$<>"1"THEN OB$(K)="2":PRINT "2000":K=0:GOTO 31021 ELSE PRINT"1950":OB$(K)="1":K=0:GOTO 31021
31054 IF A$<":"AND A$>"/"THEN OB$(K)=A$:GOTO 31018
31057 GOTO 31024
31060 GOSUB 30000:IK=0:FOR I=0 TO 12:IF OB$(I)=CHR$(176) THEN OB$(I)="0":IK=IK+1
31063 NEXT I:RA=VAL(OB$(0)+OB$(1))+(VAL(OB$(2)+OB$(3)))/60+(VAL(OB$(4)+OB$(5)))/3600:DEC=VAL(OB$(7)+OB$(8))+(VAL(OB$(9)+OB$(10)))/60+(VAL(OB$(11)+OB$(12)))/3600:IF OB$(6)="-"THEN DEC=-DEC
31066 OV=0:IF IK>10 OR RA>24 OR RA<0 OR DEC>90 OR DEC<-90 THEN OV=1:GOTO 31000
31067 IF OB$(13)="1"THEN GOSUB 30584 ELSE ON IPREC GOSUB 19900,20000
31069 GOSUB 20300:DEF SEG:POKE &H4E,IC1:IF Z=0 THEN 31075 ELSE ID=3:IS=3:IR=0:IX=0:IF X<160 THEN IX=182:IR=1:IS=26