gunner.b 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. 10 rem gunner program
  2. 90 randomize
  3. 100 print "this program simulates the results "
  4. 110 print "of firing a field artillery weapon"
  5. 120 print
  6. 130 print "you are the officer-in-charge, giving orders to the gun"
  7. 140 print "crew, telling them the degrees of elevation you estimate"
  8. 150 print "will place the projectile on target. A hit within 100 yards"
  9. 160 print "of the target will destroy it. Take more than 5 shots,"
  10. 170 print "end the enemy will destroy you!":print
  11. 180 print "maximum range of your gun is 46500 yards."
  12. 185 z=0
  13. 190 print
  14. 195 s1=0
  15. 200 t= 43000-30000*rnd(x)
  16. 210 s=0
  17. 220 goto 370
  18. 230 print"minimum elevation of the gun is one degree."
  19. 240 goto 390
  20. 250 print "maximum elevation of gun is 89 degrees."
  21. 260 goto 390
  22. 270 print "over target by";abs(e);"yards"
  23. 280 goto 390
  24. 290 print "short of target by";abs(e);"yards"
  25. 300 goto 390
  26. 310 goto 320
  27. 320 print "*****target destroyed ****";s;"rounds of ammunition expended"
  28. 322 gosub 600
  29. 325 s1=s1+s
  30. 330 if z=4 then 490
  31. 340 z=z+1
  32. 345 print
  33. 350 print "the forward observer has sighted more enemy activity."
  34. 360 goto 200
  35. 370 print " distance to the target is";int(t);"yards...."
  36. 380 print
  37. 390 print
  38. 400 print "elevation";
  39. 410 input b
  40. 420 if b>89 then 250
  41. 430 if b<1 then 230
  42. 440 s=s+1
  43. 442 if s<6 then 450
  44. 444 print:print "BOOM !!! You have been destroyed";
  45. 445 gosub 600
  46. 446 print "by the enemy":print:print:goto 495
  47. 450 b2=2*b/57.3:let i=46500*sin(b2):x=t-i:e=int(x)
  48. 460 if abs(e)<100 then 310
  49. 470 if e>100 then 290
  50. 480 if e<-100 then 270
  51. 490 print:print:print "total rounds expended were";s1
  52. 491 if s1>15 then 495:print "nice shooting!!":gosub 600:goto 500
  53. 495 print "better go back to fort silly for refresher training!"
  54. 500 print:print "thank you for playing!"
  55. 505 print:print "try again....":print:goto 180
  56. 600 rem for n=1 to 10 print chr$(7): rem next n
  57. 610 return
  58. 999 end