home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1999 January
/
Simtel-MSDOS-Jan1999-CD2.iso
/
basic
/
hurrican.bqs
/
hurrican.bas
Wrap
BASIC Source File
|
1998-12-10
|
7KB
|
153 lines
2 REM *Hurricane Locate* By: ???
4 REM Mod. By: K.D. Wentzel, Charlotte, NC
5 REM ********************
6 REM Input your coordinates in degrees, example:
7 REM 23 deg 30 min. you would enter as 23.5
8 REM ********************
10 CLEAR 100:CLS :LOCATE 7,1:PRINT "";:GOSUB 1050:FOR TT= 1 TO 2000:NEXT
20 CLS :PRINT :GOSUB 1050:PRINT : PRINT
30 PRINT"ENTER (H) for HOME Location ..."
40 PRINT" (W) for Wilmington / Wrightsville Beach area"
50 PRINT" (M) for Myrtle Beach area"
60 PRINT" (C) for Charleston area."
70 PRINT : PRINT "or just press ENTER to input your own Local Coordinates: ";: INPUT MHC$
80 IF (MHC$="H")OR(MHC$="h")THEN II$="East Charlotte" : A=35.208 : G=80.808 : GOTO 130
90 IF (MHC$="W")OR(MHC$="w")THEN II$="Wilmington NC" : A=34.167 : G=77.867 : GOTO 130
100 IF (MHC$="M")OR(MHC$="m")THEN II$="Myrtle Beach SC" : A=33.7 : G=78.85 : GOTO 130
105 IF (MHC$="C")OR(MHC$="c")THEN II$="Charleston SC" : A=32.783 : G=79.933 : GOTO 130
107 PRINT :PRINT
110 INPUT "Enter The Name of Your Location ";II$
120 PRINT :INPUT "Enter Your LATITUDE in Degrees";A:PRINT :INPUT "Your LONGITUDE in Degrees";G
130 CLS :PRINT :GOSUB 1050:PRINT
140 INPUT "What is the Name of the Hurricane ";A$:PRINT
150 PRINT "Input LATITUDE of Hurricane ";A$;" in Degrees";:INPUT B:PRINT
160 PRINT "Input LONGITUDE of Hurricane ";A$;" in Degrees";:INPUT H
170 PRINT :PRINT "What is ";A$;"'s Current Direction of Travel (in Degrees)";:INPUT DD
180 PRINT :PRINT "What is ";A$;"'s Current Speed (MPH)";:INPUT SS
190 :' **** CALCULATE LOCATION AND DISTANCE ****
200 CLS :IF A=B AND G=H THEN H=H+.1
210 PRINT :GOSUB 1050:I=G-H:L=I
220 IF (I<180) AND (I>-180) GOTO 260
230 J=I+360:L=J
240 IF (J<180) AND (J>-180) GOTO 260
250 L=I-360
260 IF L>0 THEN R=1
270 IF L<0 THEN R=0
280 E=SIN(A*.0174533):F=SIN(B*.0174533):K=COS(A*.0174533)
290 M=COS(B*.0174533):N=COS(L*.0174533):D=(E*F)+(K*M*N)
300 O=(-ATN(D/SQR(-D*D+1))+1.5708)*57.29578
310 P=SIN(O*.0174533):Q=(F-(E*D))/(K*P)
320 C=INT((-ATN(Q/SQR(-Q*Q+1))+1.5708)*57.29578)
330 IF R=0 THEN C=360-C
340 QQ=(E-(F*D))/(M*P)
350 CC=INT((-ATN(QQ/SQR(-QQ*QQ+1))+1.5708)* 57.29578)
360 IF R=1 THEN CC=360-CC
370 D=O*60*1.15078:D=INT(D+.5):PRINT
380 :' **** DETERMINE DIRECTION ****
390 IF C>=0 AND C<15 THEN G$="NORTH":GOTO 480
400 IF C>=15 AND C<75 THEN G$="NORTHEAST":GOTO 480
410 IF C>=75 AND C<105 THEN G$="EAST":GOTO 480
420 IF C>=105 AND C<165 THEN G$="SOUTHEAST":GOTO 480
430 IF C>=165 AND C<195 THEN G$="SOUTH":GOTO 480
440 IF C>=195 AND C<225 THEN G$="SOUTHWEST":GOTO 480
450 IF C>=255 AND C<285 THEN G$="WEST":GOTO 480
460 IF C>=285 AND C<345 THEN G$="NORTWEST":GOTO 480
470 G$="NORTH"
480 GOSUB 610:GOSUB 1040
490 :' **** PRINT NO ALARM TEXT ****
500 PRINT "HURRICANE ";A$;" is Currently ";D;" Miles ";G$;" Of"
510 PRINT II$;". Bearing From ";II$
520 PRINT "IS ";C;" Degrees From True North."
530 GOSUB 1040
540 PRINT "If Hurricane ";A$;" Maintains its Current Speed of ";SS;"(mph)
550 PRINT "THERE IS NO CAUSE FOR ALARM. Please Continue To Monitor"
560 PRINT "Hurricane ";A$;" Closely."
570 GOSUB 1040
572 PRINT :PRINT
573 PRINT" N O A A Weather Radio" : PRINT
574 PRINT" Charlotte 162.475 MHz"
575 PRINT" Wilmington NC 162.55"
576 PRINT" Myrtle Beach SC 162.4"
577 PRINT" Charleston SC 162.55"
578 PRINT" Beaufort SC 162.475"
579 PRINT" Cape Hatteras 162.55" : PRINT
580 PRINT :FOR TT= 1 TO 1000:NEXT :PRINT "Press ENTER to Input New Status On Hurricane ";A$;:INPUT UU$
590 CLS :PRINT :GOSUB 1050:PRINT :GOTO 150
600 :' **** DETERMINE IF PATH IS IN YOUR DIRECTION ****
610 KK=10:IF D<200 THEN KK=20
620 IF D<400 THEN KK=15
630 IF D<90 THEN 1280
640 P$=II$
650 IF DD<(CC+KK) AND DD>(CC-KK) THEN 710
660 IF DD<KK AND CC>360-(KK-DD) THEN 710
670 IF DD>(360-KK) AND CC<KK-(360-DD) THEN 710
680 IF D<100 THEN 710
690 RETURN
700 :' **** PRINT INITIAL WARNING ****
710 CLS
720 FOR XX=1 TO 4
730 LOCATE 6,61:PRINT " * * * H U R R I C A N E * * * "
740 LOCATE 9,63:PRINT " * * * A L E R T * * *"
750 FOR TT=1 TO 250:NEXT TT:CLS:FOR TT=1 TO 10:NEXT TT
760 NEXT XX
770 TIME=D/SS
780 TS=FIX(TIME):TB=TIME-TS:TC=FIX(TB*60)
790 II= 5
800 :' **** DETERMINE HURCON NUMBER ****
810 IF TS<72 THEN II= 4
820 IF TS<48 THEN II= 3
830 IF TS<24 THEN II= 2
840 IF TS<12 THEN II= 1
850 :' **** PRINT HURCON WARNING TEXT ****
860 GOSUB 1050:PRINT :PRINT " * * * H U R C O N ";II;" N O W I N E F F E C T * * *":GOSUB 1040
870 PRINT "HURRICANE ";A$;" IS CURRENTLY ";D;"MILES ";G$;" OF ";II$
880 PRINT "BEARING FROM ";II$;": ";C;" DEGREES FROM TRUE NORTH."
890 GOSUB 1040
900 PRINT "IF THIS HURRICANE MAINTAINS ITS CURRENT SPEED OF ";SS;" MILES"
910 PRINT "PER HOUR AND CURRENT DIRECTION OF ";DD;" DEGREES, THE CENTER"
920 PRINT "OF THE STORM CAN BE EXPECTED TO HIT THE ";II$
930 PRINT "AREA IN APPROXIMATELY ";TS;" HOURS."
940 GOSUB 1040
950 LOCATE 15,7:PRINT "PRESS LETTER - H - TO INPUT NEW STATUS ON HURRICANE"
960 PRINT " PRESS LETTER - C - TO REVIEW HURRICANE CONDITION NUMBERS";
970 LOCATE 13,4:PRINT " * * * H U R R I C A N E W A R N I N G * * *"
980 FOR TT=1 TO 200:NEXT TT
990 LOCATE 13,1:PRINT " "
1000 FOR TT= 1 TO 20:NEXT TT
1010 MM$=INKEY$:IF (MM$="H")OR(MM$="h") THEN CLS :PRINT:GOSUB 1050:PRINT:GOTO 150
1020 IF (MM$="C")OR(MM$="c") THEN CLS:PRINT:GOTO 1080
1030 GOTO 970
1040 PRINT STRING$ (63,"*"):RETURN
1050 PRINT " * * * HURRICANE LOCATION AND DISTANCE CALCULATOR * * *"
1060 RETURN
1070 :' * * * HURCON LISTING * * *
1080 PRINT " H U R R I C A N E C O N D I T I O N S ":PRINT
1090 PRINT " A. H U R C O N 5 : A HURRICANE READINESS STATUS"
1100 PRINT " CONSISTANT WITH SOUND PRECAUTIONARY MEASURES EFFECTIVE"
1110 PRINT " JUNE 1 THROUGH NOVEMBER 30 EACH YEAR.":PRINT
1120 PRINT " B. H U R C O N 4: A HURRICANE HAS BECOME A THREAT"
1130 PRINT " TO THE ";II$;" AREA. SURFACE WINDS IN EXCESS OF 50"
1140 PRINT " COULD ARRIVE WITHIN 72 HOURS.":PRINT
1150 PRINT " C. H U R C O N 3: A HURRICANE HAS BECOME A THREAT"
1160 PRINT " TO THE ";II$;" AREA. SURFACE WINDS IN EXCESS OF 50"
1170 PRINT " KNOTS COULD ARRIVE WITHIN 48 HOURS."
1180 PRINT :INPUT " Press <ENTER> To Continue";UU$:CLS
1190 PRINT :PRINT " H U R R I C A N E C O N D I T I O N S":PRINT
1200 PRINT " D. H U R C O N 2: A HURRICANE HAS BECOME A THREAT"
1210 PRINT " TO THE ";II$;" AREA. SURFACE WINDS IN EXCESS OF 50"
1220 PRINT " KNOTS COULD ARRIVE WITHIN 24 HOURS.":PRINT
1230 PRINT " E. H U R C O N 1: A HURRICANE HAS BECOME A THREAT"
1240 PRINT " TO THE ";II$;" AREA. SURFACE WINDS IN EXCESS OF 50"
1250 PRINT " KNOTS COULD ARRIVE WITHIN 12 HOURS.":PRINT :PRINT
1260 INPUT " Press <ENTER> To Continue";UU$:CLS :GOTO 860
1270 :' **** TOO LATE MESSAGE ****
1280 CLS :LOCATE 3,5:PRINT "YOU ARE NOW IN A HURRICANE "
1290 EE=FIX(LEN(A$)/2)
1300 IF EE/2<>INT(EE/2) THEN EE=EE+1
1310 LOCATE 8,23:PRINT "* * * ";A$;" * * *"
1320 LOCATE 13,11:PRINT "G O O D L U C K"
1330 FOR X=1 TO 250:NEXT
1340 LOCATE 13,11:PRINT "+ - + - + - + - + "
1350 FOR X= 1 TO 250:NEXT
1360 GOTO 1320