codinghorror

Civil War BASIC game updated for Microsoft Small Basic in 2010

Dec 6th, 2020
1,381
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. TextWindow.CursorLeft = 26
  2. TextWindow.WriteLine("CIVIL WAR")
  3. TextWindow.CursorLeft = 15
  4. TextWindow.WriteLine("BIBLEBYTE BOOKS, MAPLE VALLEY, WASHINGTON")
  5. TextWindow.WriteLine("")
  6. TextWindow.WriteLine("")
  7. TextWindow.WriteLine("")
  8. ' ORIGINAL GAME DESIGN
  9. 'CRAM, GOODIE, HIBBARD LEXINGTON H.S.
  10. ' MODIFICATIONS
  11. 'G. PAUL, R. HESS (TIES), 1973
  12. ' UNION INFO ON LIKELY CONFEDERATE STRATEGY
  13. SArray[1]=25
  14. SArray[2]=25
  15. SArray[3]=25
  16. SArray[4]=25
  17. ' HISTORICAL DATA.
  18. CDArray[1] = "BULL RUN"
  19. M1Array[1] = 18000
  20. M2Array[1] = 18500
  21. C1Array[1] = 1967
  22. C2Array[1] = 2708
  23. MArray[1] = 1
  24. CDArray[2] = "SHILOH"
  25. M1Array[2] = 40000
  26. M2Array[2] = 44894
  27. C1Array[2] = 10699
  28. C2Array[2] = 13047
  29. MArray[2] = 3
  30. CDArray[3] = "SEVEN DAYS"
  31. M1Array[3] = 95000
  32. M2Array[3] = 115000
  33. C1Array[3] = 20614
  34. C2Array[3] = 15849
  35. MArray[3] = 3
  36. CDArray[4] = "SECOND BULL RUN"
  37. M1Array[4] = 54000
  38. M2Array[4] = 63000
  39. C1Array[4] = 10000
  40. C2Array[4] = 14000
  41. MArray[4] = 2
  42. CDArray[5] = "ANTIETAM"
  43. M1Array[5] = 40000
  44. M2Array[5] = 50000
  45. C1Array[5] = 10000
  46. C2Array[5] = 12000
  47. MArray[5] = 3
  48. CDArray[6] = "FREDERICKSBURG"
  49. M1Array[6] = 75000
  50. M2Array[6] = 120000
  51. C1Array[6] = 5377
  52. C2Array[6] = 12653
  53. MArray[6] = 1
  54. CDArray[7] = "MURFREESBORO"
  55. M1Array[7] = 38000
  56. M2Array[7] = 45000
  57. C1Array[7] = 11000
  58. C2Array[7] = 12000
  59. MArray[7] = 1
  60. CDArray[8] = "CHANCELLORSVILLE"
  61. M1Array[8] = 32000
  62. M2Array[8] = 90000
  63. C1Array[8] = 13000
  64. C2Array[8] = 17197
  65. MArray[8] = 2
  66. CDArray[9] = "VICKSBURG"
  67. M1Array[9] = 50000
  68. M2Array[9] = 70000
  69. C1Array[9] = 12000
  70. C2Array[9] = 19000
  71. MArray[9] = 1
  72. CDArray[10] = "GETTYSBURG"
  73. M1Array[10] = 72500
  74. M2Array[10] = 85000
  75. C1Array[10] = 20000
  76. C2Array[10] = 23000
  77. MArray[10] = 3
  78. CDArray[11] = "CHICKAMAUGA"
  79. M1Array[11] = 66000
  80. M2Array[11] = 60000
  81. C1Array[11] = 18000
  82. C2Array[11] = 16000
  83. MArray[11] = 2
  84. CDArray[12] = "CHATTANOOGA"
  85. M1Array[12] = 37000
  86. M2Array[12] = 60000
  87. C1Array[12] = 36700
  88. C2Array[12] = 5800
  89. MArray[12] = 2
  90. CDArray[13] = "SPOTSYLVANIA"
  91. M1Array[13] = 62000
  92. M2Array[13] = 110000
  93. C1Array[13] = 17723
  94. C2Array[13] = 18000
  95. MArray[13] = 2
  96. CDArray[14] = "ATLANTA"
  97. M1Array[14] = 65000
  98. M2Array[14] = 100000
  99. C1Array[14] = 8500
  100. C2Array[14] = 3700
  101. MArray[14] = 1
  102. D=Math.GetRandomNumber(999)/1000
  103. TextWindow.WriteLine("")
  104. TextWindow.Write("DO YOU WANT INSTRUCTIONS? ")
  105. LN110:
  106. XD = TextWindow.Read()
  107. If XD="YES" Then
  108. Goto LN160
  109. EndIf
  110. If XD="NO" Then
  111. Goto LN370
  112. EndIf
  113. TextWindow.Write("YES OR NO — ")
  114. Goto LN110
  115. LN160:
  116. TextWindow.WriteLine("")
  117. TextWindow.WriteLine("")
  118. TextWindow.WriteLine("")
  119. TextWindow.WriteLine("")
  120. TextWindow.WriteLine("THIS IS A CIVIL WAR SIMULATION.")
  121. TextWindow.WriteLine("TO PLAY TYPE A RESPONSE WHEN THE COMPUTER ASKS.")
  122. TextWindow.WriteLine("REMEMBER THAT ALL FACTORS ARE INTERRELATED AND THAT YOUR")
  123. TextWindow.WriteLine("RESPONSES COULD CHANGE HISTORY. FACTS AND FIGURES USED ARE")
  124. TextWindow.WriteLine("BASED ON THE ACTUAL OCCURRENCE. MOST BATTLES TEND TO RESULT")
  125. TextWindow.WriteLine("AS THEY DID IN THE CIVIL WAR, BUT IT ALL DEPENDS ON YOU!!")
  126. TextWindow.WriteLine("")
  127. TextWindow.Write("THE OBJECT OF THE GAME IS TO WIN AS MANY BATTLES AS ")
  128. TextWindow.WriteLine("POSSIBLE.")
  129. TextWindow.WriteLine("")
  130. TextWindow.WriteLine("YOUR CHOICES FOR DEFENSIVE STRATEGY ARE:")
  131. TextWindow.WriteLine(" [1] ARTILLERY ATTACK")
  132. TextWindow.WriteLine(" [2] FORTIFICATION AGAINST FRONTAL ATTACK")
  133. TextWindow.WriteLine(" [3] FORTIFICATION AGAINST FLANKING MANEUVERS")
  134. TextWindow.WriteLine(" [4] FALLING BACK")
  135. TextWindow.WriteLine(" YOUR CHOICES FOR OFFENSIVE STRATEGY ARE:")
  136. TextWindow.WriteLine(" [1] ARTILLERY ATTACK")
  137. TextWindow.WriteLine(" [2] FRONTAL ATTACK")
  138. TextWindow.WriteLine(" [3] FLANKING MANEUVERS")
  139. TextWindow.WriteLine(" [4] ENCIRCLEMENT")
  140. TextWindow.WriteLine("YOU MAY SURRENDER BY TYPING A '5’ FOR YOUR STRATEGY.")
  141. LN370:
  142. TextWindow.WriteLine("")
  143. TextWindow.WriteLine("")
  144. TextWindow.WriteLine("")
  145. TextWindow.Write("ARE THERE TWO GENERALS PRESENT ")
  146. LN380:
  147. TextWindow.Write("(ANSWER YES OR NO)? ")
  148. BD = TextWindow.Read()
  149. If BD="YES" Then
  150. Goto LN430
  151. EndIf
  152. If BD <> "NO" Then
  153. Goto LN380
  154. EndIf
  155. TextWindow.WriteLine("")
  156. TextWindow.WriteLine("YOU ARE THE CONFEDERACY. GOOD LUCK!")
  157. TextWindow.WriteLine("")
  158. LN430:
  159. D=1
  160. If BD <> "YES" Then
  161. Goto LN460
  162. EndIf
  163. D=2
  164. LN460:
  165. TextWindow.WriteLine("SELECT A BATTLE BY TYPING A NUMBER FROM 1 TO 14 ON")
  166. TextWindow.WriteLine("REQUEST. TYPE ANY OTHER NUMBER TO END THE SIMULATION.")
  167. TextWindow.WriteLine("BUT '0’ BRINGS BACK EXACT PREVIOUS BATTLE SITUATION")
  168. TextWindow.WriteLine("ALLOWING YOU TO REPLAY IT")
  169. TextWindow.WriteLine("")
  170. TextWindow.WriteLine("NOTE: A NEGATIVE FOOD ENTRY CAUSES THE PROGRAM TO ")
  171. TextWindow.WriteLine("USE THE ENTRIES FROM THE PREVIOUS BATTLE")
  172. TextWindow.WriteLine("")
  173. TextWindow.Write("DO YOU WISH BATTLE DESCRIPTIONS? ")
  174. LN560:
  175. TextWindow.Write("(ANSWER YES OR NO)? ")
  176. XD = TextWindow.Read()
  177. If XD="YES" Then
  178. Goto LN600
  179. EndIf
  180. If XD <> "NO" Then
  181. Goto LN560
  182. EndIf
  183. LN600:
  184. L=0
  185. W=0
  186. R1=0
  187. Q1=0
  188. M3=0
  189. M4=0
  190. P1=0
  191. P2=0
  192. T1=0
  193. T2=0
  194. F[2]=0
  195. H[2]=0
  196. B[2]=0
  197. R2=0
  198. Q2=0
  199. C6=0
  200. F=0
  201. W0=0
  202. Y=0
  203. Y2=0
  204. U=0
  205. U2=0
  206. LN620:
  207. TextWindow.WriteLine("")
  208. TextWindow.WriteLine("")
  209. TextWindow.WriteLine("")
  210. TextWindow.Write("WHICH BATTLE DO YOU WISH TO SIMULATE? ")
  211. A = TextWindow.ReadNumber()
  212. If A <> 0 Then
  213. Goto LN660
  214. EndIf
  215. If R <> 0 Then
  216. Goto LN1140
  217. EndIf
  218. LN660:
  219. If A <=0 Then
  220. Goto LN2860
  221. EndIf
  222. If A >= 15 Then
  223. Goto LN2860
  224. EndIf
  225. CD=CDArray[A]
  226. M1=M1Array[A]
  227. M2=M2Array[A]
  228. C1=C1Array[A]
  229. C2=C2Array[A]
  230. M=MArray[A]
  231. U=0
  232. ' INFLATION CALC
  233. I1=10+(L-W)*2
  234. I2=10+(W-L)*2
  235. ' – MONEY AVAILABLE
  236. DArray[1]=100*Math.Floor((M1*(100-I1)/2000)*(1+(R1-Q1)/(R1+1))+.5)
  237. DArray[2]=100*Math.Floor(M2*(100-I2)/2000+.5)
  238. If BD <> "YES" Then
  239. Goto LN1050
  240. EndIf
  241. DArray[2]=100*Math.Floor((M2*(100-I2)/2000)*(1+(R2-Q2)/(R2+1))+.5)
  242. LN1050:
  243. ' – MEN AVAILABLE
  244. M5=Math.Floor(M1*(1+(P1-T1)/(M3+1)))
  245. M6=Math.Floor(M2*(1+(P2-T2)/(M4+1)))
  246. F1=5*M1/6
  247. TextWindow.WriteLine("")
  248. TextWindow.WriteLine("")
  249. TextWindow.WriteLine("")
  250. TextWindow.WriteLine("")
  251. TextWindow.WriteLine("")
  252. TextWindow.WriteLine("THIS IS THE BATTLE OF "+CD)
  253. If XD="NO" Then
  254. Goto LN1150
  255. EndIf
  256. If A>11 Then
  257. Goto LN1130
  258. EndIf
  259. If (A = 1) Then
  260. Goto LN3580
  261. ElseIf (A = 2) Then
  262. Goto LN3620
  263. ElseIf (A = 3) Then
  264. Goto LN3650
  265. ElseIf (A = 4) Then
  266. Goto LN3690
  267. ElseIf (A = 5) Then
  268. Goto LN3720
  269. ElseIf (A = 6) Then
  270. Goto LN3750
  271. ElseIf (A = 7) Then
  272. Goto LN3780
  273. ElseIf (A = 8) Then
  274. Goto LN3800
  275. ElseIf (A = 9) Then
  276. Goto LN3830
  277. ElseIf (A = 10) Then
  278. Goto LN3860
  279. ElseIf (A = 11) Then
  280. Goto LN3890
  281. EndIf
  282. LN1130:
  283. If (A-11 = 1) Then
  284. Goto LN3920
  285. ElseIf (A-11 = 2) Then
  286. Goto LN3950
  287. ElseIf (A-11 = 3) Then
  288. Goto LN3980
  289. EndIf
  290. LN1140:
  291. TextWindow.WriteLine(CD+" INSTANT REPLAY")
  292. LN1150:
  293. TextWindow.WriteLine("")
  294. TextWindow.WriteLine(" CONFEDERACY UNION")
  295. TextWindow.WriteLine("MEN "+M5+" "+M6)
  296. TextWindow.WriteLine("MONEY "+"$"+DArray[1]+" $"+DArray[2])
  297. TextWindow.WriteLine("INFLATION "+(I1+15)+"%"+" "+I2+"%")
  298. TextWindow.WriteLine("")
  299. 'ONLY IN PRINTOUT IS CONFED INFLATION = I1+15%)
  300. ' – IF TWO GENERALS, INPUT CONFED. FIRST
  301. For I=1 To D
  302. If BD <> "YES" Then
  303. Goto LN1260
  304. EndIf
  305. If I=2 Then
  306. Goto LN1260
  307. EndIf
  308. TextWindow.Write("CONFEDERATE GENERAL—")
  309. LN1260:
  310. TextWindow.WriteLine("HOW MUCH DO YOU WISH TO SPEND FOR")
  311. LN1270:
  312. TextWindow.Write(" – FOOD……? ")
  313. F = TextWindow.ReadNumber()
  314. If F >= 0 Then
  315. Goto LN1360
  316. EndIf
  317. If R1 <> 0 Then
  318. Goto LN1330
  319. EndIf
  320. TextWindow.WriteLine("NO PREVIOUS ENTRIES")
  321. Goto LN1270
  322. LN1330:
  323. TextWindow.WriteLine("ASSUME YOU WANT TO KEEP SAME ALLOCATIONS")
  324. TextWindow.WriteLine("")
  325. Goto LN1510
  326. LN1360:
  327. FArray[I]=F
  328. LN1370:
  329. TextWindow.Write(" – SALARIES..? ")
  330. HArray[I] = TextWindow.ReadNumber()
  331. N=1
  332. If HArray[I]<0 Then
  333. Goto LN1490
  334. EndIf
  335. LN1410:
  336. TextWindow.Write(" – AMMUNITION? ")
  337. BArray[I] = TextWindow.ReadNumber()
  338. N=2
  339. If BArray[I]<0 Then
  340. Goto LN1490
  341. EndIf
  342. TextWindow.WriteLine("")
  343. If FArray[I]+HArray[I]+BArray[I] <= DArray[I] Then
  344. Goto LN1510
  345. EndIf
  346. TextWindow.WriteLine("THINK AGAIN! YOU HAVE ONLY $"+DArray[I])
  347. Goto LN1270
  348. LN1490:
  349. TextWindow.WriteLine("NEGATIVE VALUES NOT ALLOWED.")
  350. If (N = 1) Then
  351. Goto LN1370
  352. ElseIf (N = 2) Then
  353. Goto LN1410
  354. EndIf
  355. LN1510:
  356. If BD <> "YES" Then
  357. Goto LN1550
  358. EndIf
  359. If I=2 Then
  360. Goto LN1550
  361. EndIf
  362. TextWindow.Write("UNION GENERAL—")
  363. EndFor
  364. LN1550:
  365. For Z=1 To D
  366. If BD <> "YES" Then
  367. Goto LN1620
  368. EndIf
  369. If (Z = 1) Then
  370. Goto LN1580
  371. ElseIf (Z = 2) Then
  372. Goto LN1600
  373. EndIf
  374. LN1580:
  375. TextWindow.Write("CONFEDERATE ")
  376. Goto LN1620
  377. LN1600:
  378. TextWindow.Write(" UNION ")
  379. ' – FIND MORALE
  380. LN1620:
  381. O=((2*FArray[Z]*FArray[Z]+HArray[Z]*HArray[z])/(F1*F1)+1)
  382. If O<10 Then
  383. Goto LN1660
  384. EndIf
  385. TextWindow.WriteLine("MORALE IS HIGH")
  386. Goto LN1700
  387. LN1660:
  388. If O<5 Then
  389. Goto LN1690
  390. EndIf
  391. TextWindow.WriteLine("MORALE IS FAIR")
  392. Goto LN1700
  393. LN1690:
  394. TextWindow.WriteLine("MORALE IS POOR")
  395. LN1700:
  396. If BD <> "YES" Then
  397. Goto LN1760
  398. EndIf
  399. OArray[Z]=O
  400. EndFor
  401. O2=OArray[2]
  402. O=OArray[1]
  403. TextWindow.Write("CONFEDERATE GENERAL—")
  404. LN1760:
  405. ' – ACTUAL OFF/DEF BATTLE SITUATION
  406. If M <> 3 Then
  407. Goto LN1800
  408. EndIf
  409. TextWindow.WriteLine("YOU ARE ON THE OFFENSIVE")
  410. Goto LN1840
  411. LN1800:
  412. If M <> 1 Then
  413. Goto LN1830
  414. EndIf
  415. TextWindow.WriteLine("YOU ARE ON THE DEFENSIVE")
  416. Goto LN1840
  417. LN1830:
  418. TextWindow.WriteLine("BOTH SIDES ARE ON THE OFFENSIVE ")
  419. LN1840:
  420. TextWindow.WriteLine("")
  421. ' – CHOOSE STRATEGIES
  422. If BD <> "YES" Then
  423. Goto LN1910
  424. EndIf
  425. For I=1 To 2
  426. If (I = 1) Then
  427. Goto LN1890
  428. ElseIf (I = 2) Then
  429. Goto LN1920
  430. EndIf
  431. LN1890:
  432. TextWindow.Write("CONFEDERATE STRATEGY? ")
  433. Goto LN1920
  434. LN1910:
  435. TextWindow.Write("YOUR STRATEGY? ")
  436. LN1920:
  437. Y = TextWindow.ReadNumber()
  438. If Math.Abs(Y-3)<3 Then
  439. Goto LN1960
  440. EndIf
  441. TextWindow.WriteLine("STRATEGY "+Y+" NOT ALLOWED.")
  442. Goto LN1910
  443. LN1960:
  444. If BD="YES" Then
  445. Goto LN2000
  446. EndIf
  447. If Y=5 Then
  448. Goto LN2830
  449. EndIf
  450. Sub3110()
  451. Goto LN2170
  452. LN2000:
  453. If I=2 Then
  454. Goto LN2040
  455. EndIf
  456. Y1=Y
  457. LN2020:
  458. TextWindow.Write("UNION STRATEGY? ")
  459. EndFor
  460. LN2040:
  461. Y2=Y
  462. Y=Y1
  463. If Y2=5 Then
  464. Goto LN2020
  465. EndIf
  466. '
  467. 'SIMULATED LOSSES-NORTH
  468. C6=(2*C2/5)*(1+1/(2*(Math.Abs(Y2-Y)+1)))
  469. C6=C6*(1.28+(5*M2/6)/(B[2]+1))
  470. C6=Math.Floor(C6*(1+1/O2)+.5)
  471. ' – IF LOSS > MEN PRESENT, RESCALE LOSSES
  472. E2=100/O2
  473. If Math.Floor(C6+E2)Then
  474. Goto LN2190
  475. EndIf
  476. C6=Math.Floor(13*M6/20)
  477. E2=7*C6/13
  478. U2=1
  479. LN2170:
  480. ' – CALCULATE SIMULATED LOSSES
  481. TextWindow.WriteLine("")
  482. LN2190:
  483. TextWindow.WriteLine("")
  484. TextWindow.WriteLine("")
  485. TextWindow.WriteLine(" CONFEDERACY UNION")
  486. C5=(2*C1/5)*(1+1/(2*(Math.Abs(Y2-Y)+1)))
  487. C5=Math.Floor(C5*(1+1/O)*(1.28+F1/(BArray[1]+1))+.5)
  488. E=100/O
  489. If C5+100/OThen
  490. Goto LN2270
  491. EndIf
  492. C5=Math.Floor(13*M1/20*(1+(P1-T1)/(M3+1)))
  493. E=7*C5/13
  494. U=1
  495. LN2270:
  496. If D=1 Then
  497. Goto LN2500
  498. EndIf
  499. LN2280:
  500. TextWindow.WriteLine(Text.Append("CASUALTIES ",C5)+" "+C6)
  501. TextWindow.WriteLine(Text.Append("DESERTIONS ",Math.Floor(E))+" "+Math.floor(E2))
  502. TextWindow.WriteLine("")
  503. If BD <> "YES" Then
  504. Goto LN2350
  505. EndIf
  506. TextWindow.WriteLine("COMPARED TO THE ACTUAL CASUALTIES AT "+CD)
  507. TextWindow.WriteLine("CONFEDERATE: "+Math.Floor(100*(C5/C1)+.5)+"% OF THE ORIGINAL")
  508. TextWindow.WriteLine("UNION: "+Math.Floor(100*(C6/C2)+.5)+"% OF THE ORIGINAL")
  509. LN2350:
  510. TextWindow.WriteLine("")
  511. ' – 1 WHO ONE
  512. If U <> 1 Then
  513. Goto LN2380
  514. EndIf
  515. If U2=1 Then
  516. Goto LN2460
  517. EndIf
  518. LN2380:
  519. If U=1 Then
  520. Goto LN2420
  521. EndIf
  522. If U2=1 Then
  523. Goto LN2440
  524. EndIf
  525. If C5+E=C6+E2 Then
  526. Goto LN2460
  527. EndIf
  528. If C5+EThen
  529. Goto LN2440
  530. EndIf
  531. LN2420:
  532. TextWindow.WriteLine("THE UNION WINS "+CD)
  533. Goto LN2600
  534. LN2440:
  535. TextWindow.WriteLine("THE CONFEDERACY WINS "+CD)
  536. Goto LN2660
  537. LN2460:
  538. TextWindow.WriteLine("BATTLE OUTCOME UNRESOLVED")
  539. W0=W0+1
  540. If A=0 Then
  541. Goto LN2790
  542. EndIf
  543. Goto LN2680
  544. LN2500:
  545. C6=Math.Floor(17*C2*C1/(C5*20))
  546. E2=5*O
  547. Goto LN2280
  548. TextWindow.WriteLine("YOUR CASUALTIES WERE "+math.floor(100*(C5/C1)+.5)+"% OF ")
  549. TextWindow.WriteLine("THE ACTUAL CASUALTIES AT "+CD)
  550. TextWindow.WriteLine("")
  551. ' – FIND WHO WON
  552. If U=1 Then
  553. Goto LN2590
  554. EndIf
  555. If C5+E<17*C2*C1/(C5*20)+5*O Then
  556. Goto LN2630
  557. EndIf
  558. LN2590:
  559. TextWindow.WriteLine("YOU LOSE "+CD)
  560. LN2600:
  561. If A=0 Then
  562. Goto LN2790
  563. EndIf
  564. L=L+1
  565. Goto LN2680
  566. LN2630:
  567. TextWindow.WriteLine("YOU WIN "+CD)
  568. ' – CUMULATIVE BATTLE FACTORS WHICH ALTER HISTORICAL
  569. ' RESOURCES AVAILABLE.IF A REPLAY DON’T UPDATE.
  570. LN2660:
  571. If A=0 Then
  572. Goto LN2790
  573. EndIf
  574. W=W+1
  575. LN2680:
  576. T1=T1+C5+E
  577. T2=T2+C6+E2
  578. P1=P1+C1
  579. P2=P2+C2
  580. Q1=Q1+(F[1]+H[1]+B[1])
  581. Q2=Q2+(F[2]+H[2]+B[2])
  582. R1=R1+M1*(100-I1)/20
  583. R2=R2+M2*(100-I2)/20
  584. M3=M3+M1
  585. M4=M4+M2
  586. Sub3300()
  587. LN2790:
  588. U=0
  589. U2=0
  590. TextWindow.WriteLine("—————")
  591. Goto LN620
  592. ' ——FINISH OFF
  593. LN2830:
  594. TextWindow.WriteLine("THE CONFEDERACY HAS SURRENDERED")
  595. Goto LN2860
  596. TextWindow.WriteLine("THE UNION HAS SURRENDERED.")
  597. LN2860:
  598. TextWindow.WriteLine("")
  599. TextWindow.WriteLine("")
  600. TextWindow.WriteLine("")
  601. TextWindow.WriteLine("")
  602. TextWindow.WriteLine("")
  603. TextWindow.WriteLine("")
  604. TextWindow.Write("THE CONFEDERACY ")
  605. TextWindow.WriteLine("HAS WON "+W+" BATTLES AND LOST "+L)
  606. If Y=5 Then
  607. Goto LN2940
  608. EndIf
  609. If Y2=5 Then
  610. Goto LN2920
  611. EndIf
  612. If W <= L Then
  613. Goto LN2940
  614. EndIf
  615. If Y=5 Then
  616. Goto LN2940
  617. EndIf
  618. LN2920:
  619. TextWindow.WriteLine("THE CONFEDERACY HAS WON THE WAR")
  620. Goto LN2950
  621. LN2940:
  622. TextWindow.WriteLine("THE UNION HAS WON THE WAR")
  623. LN2950:
  624. TextWindow.WriteLine("")
  625. If R1=0 Then
  626. Goto LN3100
  627. EndIf
  628. TextWindow.WriteLine("FOR THE "+(W+L+W0)+" BATTLES FOUGHT (EXCUDING RERUNS)")
  629. TextWindow.Write(" ")
  630. TextWindow.WriteLine(" CONFEDERACY UNION")
  631. TextWindow.WriteLine(Text.Append("HISTORICAL LOSSES ", Math.floor(P1+.5))+" "+Math.floor(P2+.5))
  632. TextWindow.WriteLine(Text.Append("SIMULATED LOSSES ",Math.floor(T1+.5))+" "+Math.Floor(T2+.5))
  633. TextWindow.WriteLine("")
  634. TextWindow.WriteLine(Text.Append("% OF ORIGINAL ",math.floor(100*(T1/P1)+.5))+" "+Math.floor(100*(T2/P2)+.5))
  635. If BD="YES" Then
  636. Goto LN3100
  637. EndIf
  638. TextWindow.WriteLine("")
  639. TextWindow.WriteLine("UNION INTELLIGENCE SUGGESTS THAT THE SOUTH USED ")
  640. TextWindow.WriteLine("STRATEGIES 1, 2, 3, 4 IN THE FOLLOWING PERCENTAGES")
  641. TextWindow.WriteLine(" 1 – " + SArray[1])
  642. TextWindow.WriteLine(" 2 – " + SArray[2])
  643. TextWindow.WriteLine(" 3 – " + SArray[3])
  644. TextWindow.WriteLine(" 4 – " + SArray[4])
  645. ' ———————————
  646. LN3100:
  647. TextWindow.Write("Press ENTER to Stop")
  648. JJJ = TextWindow.Read()
  649. Program.End()
  650. Sub Sub3110
  651. ' – UNION STRATEGY IS COMPUTER CHOSEN
  652. TextWindow.Write("UNION STRATEGY IS ")
  653. If A <> 0 Then
  654. Goto LN3180
  655. EndIf
  656. LN3140:
  657. Y2 = TextWindow.ReadNumber()
  658. If Y2 <=0 Then
  659. Goto LN3160
  660. EndIf
  661. If Y2<5 Then
  662. Goto LN3290
  663. EndIf
  664. LN3160:
  665. TextWindow.WriteLine("ENTER 1 , 2 ,3 , OR 4 (USUALLY PREVIOUS UNION STRATEGY)")
  666. Goto LN3140
  667. LN3180:
  668. S0=0
  669. R=100*Math.GetRandomNumber(999)/1000
  670. For I=1 To 4
  671. S0=S0+SArray[I]
  672. ' – IF ACTUAL STRATEGY INFO IS IN PROGRAM DATA STATEMENTS
  673. ' THEN R-100 IS EXTRA WEIGHT GIVEN TO THAT STATEGY.
  674. If RThen
  675. Goto LN3270
  676. EndIf
  677. EndFor
  678. ' – IF ACTUAL STRAT. IN,THEN HERE IS Y2= HIST. STRAT.
  679. LN3270:
  680. Y2=I
  681. TextWindow.WriteLine(Y2)
  682. LN3290:
  683. EndSub
  684. Sub Sub3300
  685. ' LEARN PRESENT STRATEGY, START FORGETTING OLD ONES
  686. ' – PRESENT STRATEGY OF SOUTH GAINS 3*S, OTHERS LOSE S
  687. ' PROBABILITY POINTS, UNLESS A STRATEGY FALLS BELOW 5%.
  688. S = 3
  689. S0=0
  690. For I=1 To 4
  691. If SArray[I] <= 5 Then
  692. Goto LN3390
  693. EndIf
  694. SArray[I]=SArray[I]-S
  695. S0=S0+S
  696. LN3390:
  697. EndFor
  698. SArray[Y]=SArray[Y]+S0
  699. EndSub
  700. LN3580:
  701. TextWindow.WriteLine("JULY 21, 1861. GEN. BEAUREGARD, COMMANDING THE SOUTH, MET")
  702. TextWindow.WriteLine("UNION FORCES WITH GEN. MCDOWELL IN A PREMATURE BATTLE AT")
  703. TextWindow.WriteLine("BULL RUN. GEN. JACKSON HELPED PUSH BACK THE UNION ATTACK.")
  704. Goto LN1150
  705. LN3620:
  706. TextWindow.WriteLine("APRIL 6-7, 1862. THE CONFEDERATE SURPRISE ATTACK AT")
  707. TextWindow.WriteLine("SHILOH FAILED DUE TO POOR ORGANIZATION.")
  708. Goto LN1150
  709. LN3650:
  710. TextWindow.WriteLine("JUNE 25-JULY 1, 1862. GENERAL LEE (CSA) UPHELD THE")
  711. TextWindow.WriteLine("OFFENSIVE THROUGHOUT THE BATTLE AND FORCED GEN. MCCLELLAN")
  712. TextWindow.WriteLine("AND THE UNION FORCES AWAY FROM RICHMOND.")
  713. Goto LN1150
  714. LN3690:
  715. TextWindow.Write("AUG 29-30, 1862. THE COMBINED CONFEDERATE FORCES UNDER")
  716. TextWindow.WriteLine(" LEE")
  717. TextWindow.WriteLine("AND JACKSON DROVE THE UNION FORCES BACK INTO WASHINGTON.")
  718. Goto LN1150
  719. LN3720:
  720. TextWindow.WriteLine("SEPT 17, 1862. THE SOUTH FAILED TO INCORPORATE MARYLAND")
  721. TextWindow.WriteLine("INTO THE CONFEDERACY.")
  722. Goto LN1150
  723. LN3750:
  724. TextWindow.WriteLine("DEC 13, 1862. THE CONFEDERACY UNDER LEE SUCCESSFULLY")
  725. TextWindow.WriteLine("REPULSED AN ATTACK BY THE UNION UNDER GEN. BURNSIDE.")
  726. Goto LN1150
  727. LN3780:
  728. TextWindow.Write("DEC 31, 1862. THE SOUTH UNDER GEN. BRAGG WON A CLOSE ")
  729. TextWindow.WriteLine("BATTLE.")
  730. Goto LN1150
  731. LN3800:
  732. TextWindow.WriteLine("MAY 1-6, 1863. THE SOUTH HAD A COSTLY VICTORY AND LOST")
  733. TextWindow.WriteLine("ONE OF THEIR OUTSTANDING GENERALS, 'STONEWALL’ JACKSON.")
  734. Goto LN1150
  735. LN3830:
  736. TextWindow.WriteLine("JULY 4, 1863. VICKSBURG WAS A COSTLY DEFEAT FOR THE SOUTH")
  737. TextWindow.WriteLine("BECAUSE IT GAVE THE UNION ACCESS TO THE MISSISSIPPI.")
  738. Goto LN1150
  739. LN3860:
  740. TextWindow.Write("JULY 1-3, 1863. A SOUTHERN MISTAKE BY GEN. LEE AT ")
  741. TextWindow.WriteLine("GETTYSBURG")
  742. TextWindow.WriteLine("COST THEM ONE OF THE MOST CRUCIAL BATTLES OF THE WAR.")
  743. Goto LN1150
  744. LN3890:
  745. TextWindow.WriteLine("SEPT. 15, 1863. CONFUSION IN A FOREST NEAR CHICKAMAUGA LED")
  746. TextWindow.WriteLine("TO A COSTLY SOUTHERN VICTORY.")
  747. Goto LN1150
  748. LN3920:
  749. TextWindow.WriteLine("NOV. 25, 1863. AFTER THE SOUTH HAD SIEGED GEN. ROSENCRANS'")
  750. TextWindow.WriteLine("ARMY FOR THREE MONTHS, GEN. GRANT BROKE THE SIEGE.")
  751. Goto LN1150
  752. LN3950:
  753. TextWindow.WriteLine("MAY 5, 1864. GRANT’S PLAN TO KEEP LEE ISOLATED BEGAN TO")
  754. TextWindow.WriteLine("FAIL HERE, AND CONTINUED AT COLD HARBOR AND PETERSBURG.")
  755. Goto LN1150
  756. LN3980:
  757. TextWindow.WriteLine("AUGUST, 1864. SHERMAN AND THREE VETERAN ARMIES CONVERGED")
  758. TextWindow.WriteLine("ON ATLANTA AND DEALT THE DEATH BLOW TO THE CONFEDERACY.")
  759. Goto LN1150
RAW Paste Data