mirror of
https://github.com/rfivet/BCG101.git
synced 2024-12-20 17:16:23 -05:00
113 lines
4.1 KiB
QBasic
113 lines
4.1 KiB
QBasic
5 PRINT "THIS IS THE GAME OF WAR BETWEEN A SUBMARINE AND A"
|
|
10 PRINT "NAVAL GUN BOAT. WOULD YOU LIKE INSTRUCTIONS";
|
|
11 INPUT X$
|
|
12 IF X$="NO" THEN 100
|
|
13 PRINT "YOU ARE THE CAPTAIN OF THE SUBMARINE AND THE"
|
|
14 PRINT "COMPUTER IS THE CAPTAIN OF THE GUN BOAT."
|
|
20 PRINT "THE SPEED OF THE GUN BOAT WILL BE GIVEN AT THE BEGINNING OF"
|
|
25 PRINT "THE GAME AND YOU HAVE TO HIT THE GUN BOAT TWICE"
|
|
30 PRINT "IN AT LEAST TWO VULNERABLE PLACES, OR ONCE IN A "
|
|
35 PRINT "VULNERABLE PLACE AND TWICE IN ANY OTHER PART OF THE"
|
|
40 PRINT "HULL OF THE GUN BOAT. BUT IF YOU MISS ANY ONE TIME THE"
|
|
45 PRINT "GUN BOAT WILL OPEN FIRE ON YOU UNTIL IT SINKS YOU OR YOU"
|
|
50 PRINT "SINK THE GUN BOAT! YOU WILL BE ALLOWED TO TAKE TURNS FIRE-"
|
|
55 PRINT "ING AT THE GUN BOAT ......GOOD LUCK , MEIN FURHER!!!!!!!!!"
|
|
100 A=0
|
|
110 B=0
|
|
120 RANDOMIZE
|
|
130 FOR I=1 TO 5
|
|
140 LET R=100*RND(0)
|
|
170 IF R>=10 THEN 190
|
|
180 NEXT I
|
|
190 IF R<=40 THEN 210
|
|
200 GOTO 130
|
|
210 PRINT "THE SPEED OF THE GUN BOAT IS NOW ";R;" KNOTS"
|
|
220 RANDOMIZE
|
|
230 FOR F=1 TO 5
|
|
240 LET S=10000*RND(0)
|
|
270 IF S>=1000 THEN 290
|
|
280 NEXT F
|
|
290 IF S<=10000 THEN 310
|
|
300 GOTO 230
|
|
310 PRINT "THE RANGE FROM THE GUN BOAT TO THE SUBMARINE IS"
|
|
320 PRINT "NOW ";S;" YARDS."
|
|
330 LET Z=ATN(50/R)
|
|
340 LET D3=Z*(180/3.14159)
|
|
345 PRINT "THE APPROXIMATE ANGLE YOU SHOULD FIRE YOUR TORPEDO IS"
|
|
346 PRINT "BETWEEN ";INT(D3-2);" AND ";INT(D3+2);" DEGREES."
|
|
350 INPUT D
|
|
351 LET T=D*3.14159/180
|
|
360 LET R8=S/COS(Z)
|
|
370 LET Y3=R8*SIN(Z)
|
|
380 LET Y9=R8*SIN(T)
|
|
390 LET Y2=Y3-20
|
|
400 LET Y0=Y3-40
|
|
410 LET Y4=Y3+20
|
|
420 LET Y5=Y3+40
|
|
430 IF Y9<Y0 THEN 520
|
|
431 IF Y9>Y5 THEN 520
|
|
432 GOSUB 710
|
|
435 IF Y9<Y2 THEN 810
|
|
440 IF Y9<Y3 THEN 850
|
|
450 IF Y9<Y4 THEN 890
|
|
490 GOTO 930
|
|
520 PRINT "YOU MISSED!"
|
|
530 RANDOMIZE
|
|
540 LET Y9=RND(0)
|
|
550 LET W=10000*Y9
|
|
560 PRINT "THE SHOT FIRED FROM THE GUN BOAT TO THE SUBMARINE"
|
|
570 PRINT "WAS WITHIN ";ABS(W-S)*2/1000;" YARDS......."
|
|
580 IF ABS(W-S)>=2000 GOTO 120
|
|
590 PRINT "YOU ARE SUNK MEIN FRIEND!"
|
|
595 GOTO 1900
|
|
610 PRINT
|
|
612 PRINT
|
|
613 PRINT "********* YOU MADE A VUL?N?ERABLE STRIKE! *************"
|
|
620 A=A+1
|
|
630 IF A>=2 GOTO 700
|
|
640 GOTO 120
|
|
650 PRINT
|
|
651 PRINT
|
|
652 PRINT "********* YOU DAMAGED THE GUN BOAT! *************"
|
|
660 B=B+1
|
|
670 IF B>=3 GOTO 700
|
|
680 IF A+B>=3 THEN 700
|
|
690 GO TO 120
|
|
700 PRINT "I AM SUNK!........GOOD BYE CRUEL WORLD....(GLUB..GLUB..)"
|
|
705 GOTO 1800
|
|
710 PRINT " ********* **+ !"
|
|
720 PRINT " ********* ***+*+* !"
|
|
730 PRINT " HHH !"
|
|
740 PRINT " UUU ! +++++]"
|
|
750 PRINT " \\\\===0=0=0"
|
|
760 PRINT " L---------I"
|
|
770 PRINT " --/DR IIIIIIIIII /DD\--"
|
|
780 PRINT " [=======================]"
|
|
790 PRINT " ----/DDDR /HHHHH O O O O O HHHH\ /PDDD\----"
|
|
800 RETURN
|
|
810 PRINT " EEEEEEEEEEE\.................../EEEEEEEEEEEEEEEEEEEE/"
|
|
820PRINT" EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE O EEEEEEEEE/"
|
|
830PRINT" * EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/"
|
|
840 GO TO 610
|
|
850PRINT"\EEEEEEEEEEEEEEEEEEEEEEE\.................../EEEEEEEEEEEEEEEEE/"
|
|
860PRINT" EEEEEEEEEEE EEEEEEEEEEEEEEEEEEEEEEEEEE 0 EEEEEE/"
|
|
870PRINT" \EEEEEE * EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/"
|
|
880 GO TO 650
|
|
890PRINT"\EEEEEEEEEEEEEEEEEEEEEEEE.................../EEEEEEEEEEEEEEEEEE/"
|
|
900PRINT" EEEEEEEEEEEEEEEEE EEEEE O EEEE/"
|
|
910PRINT" \EEEEEEEEEEEEEE EEEEEEEEEEEEEEEE/"
|
|
920 GO TO 610
|
|
930PRINT"\EEEEEEEEEEEEEEEEEE\......................./EEEEEEEEEEEEEEEEEE/"
|
|
950PRINT" EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
|
|
960PRINT" \EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE *"
|
|
970 GO TO 650
|
|
1800 PRINT " /!"
|
|
1801 PRINT " //HH!"
|
|
1802 PRINT " X> T/HHHH!"
|
|
1803 PRINT " *******************************"
|
|
1804 PRINT
|
|
1900 PRINT "WOULD YOU LIKE TO TRY AGAIN";
|
|
1901 INPUT Z$
|
|
1902 IF Z$="YES" THEN 5
|
|
2000 END
|