home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / cannon.zip / CANNON.BAS
BASIC Source File  |  1984-12-24  |  2KB  |  69 lines

  1. 1000 CLS: PRINT TAB(30);"CANNONEER"
  2. 1010 PRINT:PRINT:PRINT
  3. 1020 PRINT"You are the commander of a gun crew for a long-range"
  4. 1030 PRINT"cannon. You must give your crew the proper angle "
  5. 1040 PRINT"of elevation in degrees to put your rounds on the "
  6. 1050 PRINT"target. A hit by one of your high explosive rounds "
  7. 1060 PRINT"within a hundered meters of the target will destroy it. "
  8. 1070 PRINT
  9. 1080  SEC = 18.2 'clock ticks to make 1 second used for sound stmt
  10. 1090 R=INT(4000*RND(6)+10000)
  11. 1100 PRINT"The maximum range of your gun is ";R;" meters."
  12. 1110 Z=0
  13. 1120 PRINT
  14. 1130 S1=0
  15. 1140 T=INT(R*(.1+.8*RND(6)))
  16. 1150 S=0
  17. 1160 GOTO 1370
  18. 1170 PRINT"Barrel cannot be depressed below one degree."
  19. 1180 GOTO 1400
  20. 1190 PRINT"Barrel elevation cannot exceed 89 degrees."
  21. 1200 GOTO 1400
  22. 1210 PRINT"Forward observer reports round was long by ";ABS(E);" meters."
  23. 1220 GOTO 1400
  24. 1230 PRINT"Forward observer reports round was short by ";ABS(E);" meters."
  25. 1240 GOTO 1400
  26. 1250 PRINT"### TARGET DESTROYED###     ";S;" rounds fired."
  27. 1260 S1=S1+S
  28. 1270 IF Z=4 THEN 1580
  29. 1280 Z=Z+1
  30. 1290 PRINT
  31. 1300 FOR J = 1 TO 5
  32. 1310 FOR FREQ = 500 TO 3500 STEP 100
  33. 1320 SOUND FREQ,.35
  34. 1330 NEXT FREQ
  35. 1340 NEXT J
  36. 1350 PRINT"Forward observer has sighted new activity!!!"
  37. 1360 GOTO 1140
  38. 1370 PRINT"      Range to target is ";T;" meters."
  39. 1380 PRINT"      Fire for effect!"
  40. 1390 PRINT:PRINT
  41. 1400 INPUT "Elevation? ",B
  42. 1410 IF B>89 THEN 1190
  43. 1420 IF B<1 THEN 1170
  44. 1430 SOUND 400,.5*SEC
  45. 1440 FOR FREQ = 3000 TO 4000 STEP 10
  46. 1450  SOUND FREQ, .02*SEC
  47. 1460 NEXT FREQ
  48. 1470 SOUND 150,.5*SEC
  49. 1480 S=S+1
  50. 1490 IF S<6 THEN 1540
  51. 1500 PRINT
  52. 1510 SOUND 100,10
  53. 1520 PRINT"BOOM!!!  You have just been destroyed by enemy fire."
  54. 1530 PRINT:PRINT:PRINT: GOTO 1620
  55. 1540 B2=2*B/57.3 : I = R*SIN(B2) : X=T-I : E=INT(X)
  56. 1550 IF ABS(E)<100 THEN 1250 'target destroyed
  57. 1560 IF E>100 THEN 1230 'round short
  58. 1570 GOTO 1210 'over target
  59. 1580 PRINT:PRINT:PRINT"Total rounds expended: ";S1
  60. 1590 IF S1>18 THEN 1620
  61. 1600 PRINT "Nice shooting! There could be a promotion in ths for you."
  62. 1610 GOTO 1640
  63. 1620 PRINT "The cook can do better! Did you sleep through artillery"
  64. 1630 PRINT "school? You need a refresher at Fort Sill."
  65. 1640 PRINT: INPUT "Another target? (Y or N)";Z$
  66. 1650 IF Z$="Y" OR Z$= "y" THEN 1090
  67. 1660 PRINT "You deserve some R&R. See you later."
  68. 1670 END
  69.