1
0
mirror of https://github.com/rfivet/BCG101.git synced 2024-12-24 11:06:58 -05:00
BCG101/dec/SPLAT.BAS

123 lines
4.8 KiB
QBasic
Raw Normal View History

2024-05-26 22:07:55 -04:00
30 OPEN "PARACH.UTE" AS FILE 1%
40 DIM #1%,A(4000)
55 RANDOMIZE
95 PRINT "WELCOME TO 'SPLAT' -- THE GAME THAT SIMULATES A PARACHUTE"
96 PRINT "JUMP. TRY TO OPEN YOUR CHUTE AT THE LAST POSSIBLE"
97 PRINT "MOMENT WITHOUT GOING SPLAT."
118 PRINT\PRINT\D1=0\V=0\A=0\N=0\M=0\D1=INT(9001*RND(1)+1000)
119 PRINT " SELECT YOUR OWN TERMINAL VELOCITY (YES OR NO)";\INPUT A1$
120 IF A1$="NO" THEN 128 ELSE IF A1$="YES" THEN 123
121 PRINT "'YES' OR 'NO' PLEASE";\INPUT A1$\GOTO 120
123 PRINT "WHAT TERMINAL VELOCITY (MI/HR)";\INPUT V1
125 V1=V1*(5280/3600)\V=V1+((V1*RND(0))/20)-((V1*RND(0))/20)\GOTO 135
128 V1=INT(1000*RND(0))
130 PRINT "OK. TERMINAL VELOCITY ="V1"MI/HR"
131 V1=V1*(5280/3600)\V=V1+((V1*RND(0))/20)-((V1*RND(0))/20)
135 PRINT "WANT TO SELECT ACCELERATION DUE TO GRAVITY (YES OR NO)";
136 INPUT B1$
140 IF B1$="NO" THEN 150 ELSE IF B1$="YES" THEN 143
141 PRINT "'YES' OR 'NO' PLEASE";\INPUT B1$\GOTO 140
143 PRINT "WHAT ACCELERATION (FT/SEC/SEC)";\INPUT A2
145 A=A2+((A2*RND(0))/20)-((A2*RND(0))/20)\GOTO 205
150 ON INT(1+(10*RND(0)))GOTO 151,152,153,154,155,156,157,158,159,160
151 PRINT"FINE. YOU'RE ON MERCURY. ACCELERATION=12.2 FT/SEC/SEC."\GOTO 161
152 PRINT"ALRIGHT. YOU'RE ON VENUS. ACCELERATION=28.3 FT/SEC/SEC."\GOTO 162
153 PRINT "THEN YOU'RE ON EARTH. ACCELERATION=32.16 FT/SEC/SEC."\GOTO 163
154 PRINT"FINE. YOU'RE ON THE MOON. ACCELERATION=5.15 FT/SEC/SEC."\GOTO 164
155 PRINT"ALRIGHT. YOU'RE ON MARS. ACCELERATION=12.5 FT/SEC/SEC."\GOTO 165
156 PRINT"THEN YOU'RE ON JUPITER. ACCELERATION=85.2 FT/SEC/SEC."\GOTO 166
157 PRINT"FINE. YOU'RE ON SATURN. ACCELERATION=37.6 FT/SEC/SEC."\GOTO 167
158 PRINT"ALRIGHT. YOU'RE ON URANUS. ACCELERATION=33.8 FT/SEC/SEC."\GOTO 168
159 PRINT"THEN YOU'RE ON NEPTUNE. ACCELERATION=39.6 FT/SEC/SEC."\GOTO 169
160 PRINT"FINE. YOU'RE ON THE SUN. ACCELERATION=896 FT/SEC/SEC."\GOTO 170
161 A2=12.2\GOTO 145
162 A2=28.3\GOTO 145
163 A2=32.16\GOTO 145
164 A2=5.15\GOTO 145
165 A2=12.5\GOTO 145
166 A2=85.2\GOTO 145
167 A2=37.6\GOTO 145
168 A2=33.8 \GOTO 145
169 A2=39.6\GOTO 145
170 A2=896\GOTO 145
205 PRINT
206 PRINT " ALTITUDE ="D1"FT"
207 PRINT " TERM.VELOCITY ="V1"FT/SEC +-5%"
208 PRINT " ACCELERATION ="A2"FT/SEC/SEC +-5%"
210 PRINT "SET THE TIMER FOR YOUR FREEFALL."
211 PRINT "HOW MANY SECONDS";\INPUT T
215 PRINT "HERE WE GO."
217 PRINT
218 PRINT "TIME (SEC)","DIST TO FALL (FT)"
219 PRINT "==========","================="
300 FOR I=0 TO T STEP (T/8)
310 IF I>V/A GOTO 400
320 D=D1-((A/2)*I^2)
330 IF D<=0 GOTO 1000
340 PRINT I,D
350 NEXT I
360 GOTO 500
400 PRINT "TERMINAL VELOCITY REACHED AT T PLUS"V/A"SECONDS"
405 FOR I=I TO T STEP (T/8)
410 D=D1-((V^2/(2*A))+(V*(I-(V/A))))
420 IF D<=0 GOTO 1010
430 PRINT I,D
440 NEXT I
450 GOTO 500
500 PRINT "CHUTE OPEN"
510 K=0\K1=0
530 FOR I=1 TO 4000
550 IF A(I)=0 GOTO 620
560 K=K+1
570 IF D>=A(I) GOTO 600
580 K1=K1+1
600 NEXT I
620 A(I)=D
630 I=I-1
650 IF K-K1<=.1*K GOTO 700
660 IF K-K1<=.25*K GOTO 710
670 IF K-K1<=.5*K GOTO 720
680 IF K-K1<=.75*K GOTO 730
690 IF K-K1<=.9*K GOTO 740
695 GOTO 750
700 PRINT "WOW! THAT'S SOME JUMPING. OF THE"K"SUCCESSFUL JUMPS"
701 PRINT "BEFORE YOURS, ONLY"K-K1"OPENED THEIR CHUTES LOWER THAN"
702 PRINT "YOU DID."
703 GOTO 2000
710 PRINT "PRETTY GOOD! " K"SUCCESSFUL JUMPS PRECEDED YOURS AND ONLY"
711 PRINT K-K1" OF THEM GOT LOWER THAN YOU DID BEFORE THEIR CHUTES"
712 PRINT "OPENED." \GOTO 2000
720 PRINT "NOT BAD. THERE HAVE BEEN"K"SUCCESSFUL JUMPS BEFORE YOURS."
721 PRINT"YOU WERE BEATEN OUT BY"K-K1"OF THEM."\GOTO 2000
730 PRINT "CONSERVATIVE AREN'T YOU? YOU RANKED ONLY"K-K1"IN THE"
731 PRINT K"SUCCESSFUL JUMPS BEFORE YOURS."\GOTO 2000
740 PRINT "HUMPH! DON'T YOU HAVE ANY SPORTING BLOOD? THERE WERE"
741 PRINT K"SUCCESSFUL JUMPS BEFORE YOURS AND YOU CAME IN"K1"JUMPS"
742 PRINT "BETTER THAN THE WORST. SHAPE UP!!!"\GOTO 2000
750 PRINT "HEY! YOU PULLED THE RIP CORD MUCH TOO SOON. "K"SUCCESSFUL"
751 PRINT "JUMPS BEFORE YOURS AND YOU CAME IN NUMBER"K-K1"! GET WITH IT!"
752 GOTO 2000
800 PRINT "REQUIESCAT IN PACE."\GOTO 1950
801 PRINT "MAY THE ANGEL OF HEAVEN LEAD YOU INTO PARADISE"\GOTO 1950
802 PRINT "REST IN PEACE"\GOTO 1950
803 PRINT "SON-OF-A-GUN"\GOTO 1950
804 PRINT "#$%&&%!$"\GOTO 1950
805 PRINT "A KICK IN THE PANTS IS A BOOST IF YOU'RE HEADED RIGHT"\GOTO 1950
806 PRINT "HMMM. SHOULD HAVE PICKED A SHORTER TIME."\GOTO 1950
807 PRINT "MUTTER. MUTTER. MUTTER."\GOTO 1950
808 PRINT "PUSHING UP DAISIES."\GOTO1950
809 PRINT "EASY COME, EASY GO."\GOTO 1950
1000 PRINT SQR(2*D1/A),"SPLAT"
1005 ON INT(1+(10*RND(0)))GOTO 800,801,802,803,804,805,806,807,808,809
1010 PRINT (V/A)+((D1-(V^2/(2*A)))/V),"SPLAT"
1020 GOTO 1005
1950 PRINT "I'LL GIVE YOU ANOTHER CHANCE."\GOTO 2000
2000 PRINT "DO YOU WANT TO PLAY AGAIN";\INPUT Z$
2001 IF Z$="YES" GOTO 118
2002 IF Z$="NO" GOTO 2005
2003 PRINT "YES OR NO"\GOTO 2000
2005 PRINT "PLEASE";\INPUT Z$\IF Z$="YES" THEN 118 ELSE 2007
2007 PRINT "SSSSSSSSSS."\GOTO 2046
2046 CLOSE 1%
9999 END