10 REM THIS IS A MODIFIED VERSION OF "CIVIL WAR" FROM
20 REM "THE BEST OF CREATIVE COMPUTING", PAGE 254 OF
30 REM VOLUME 1. ORIGINAL PROGRAM BY L. CRAM, L. GOODIE,
40 REM AND D. HIBBARD.
50 L=0:W=0:R=0:P1=0:Q1=0:M3=0:M4=0
60 PRINT CHR$(26):REM Screen clear
70 INPUT "DO YOU WANT DESCRIPTIONS (YES or NO)";Z$
80 PRINT CHR$(26);:IF LEFT$(Z$,1)<>"Y" THEN 300
90 PRINT "THIS IS A CIVIL WAR SIMULATION."
100 PRINT "TO PLAY, TYPE A RESPONSE WHEN THE PROGRAM ASKS FOR ONE."
110 PRINT "REMEMBER THAT ALL FACTORS ARE INTERRELATED AND THAT YOUR"
120 PRINT "RESPONSES COULD CHANGE HISTORY.  FACTS AND FIGURES USED"
130 PRINT "ARE BASED ON ACTUAL OCCURRENCE. MOST BATTLES TEND TO RESULT"
140 PRINT "AS THEY DID IN THE CIVIL WAR, BUT IT ALL DEPENDS ON YOU!!"
150 PRINT
160 PRINT "THE OBJECT OF THIS GAME IS TO WIN AS MANY BATTLES AS POSSIBLE."
170 PRINT:PRINT "YOUR CHOICES FOR DEFENSIVE STRATEGY ARE:"
180 PRINT "        1) ARTILLERY ATTACK"
190 PRINT "        2) FORTIFICATION AGAINST FRONTAL ATTACK"
200 PRINT "        3) FORTIFICATION AGAINST FLANKING MANEUVERS"
210 PRINT "        4) FALLING BACK"
220 GOSUB 1750
230 PRINT "YOUR CHOICES FOR OFFENSIVE STRATEGY ARE:"
240 PRINT "        1) ARTILLERY ATTACK"
250 PRINT "        2) FRONTAL ATTACK"
260 PRINT "        3) FLANKING MANEUVERS"
270 PRINT "        4) ENCIRCLEMENT"
280 PRINT "YOU MAY SURRENDER BY TYPING A '5' FOR YOUR STRATEGY.":PRINT
290 PRINT "YOU ARE THE CONFEDERACY.  GOOD LUCK!":PRINT:GOSUB 1750
300 READ M1,M2,C1,C2,M,A,U:I1=10+(L-W)*2:I2=10+(W-L)*2
310 D1=100*INT((M1*(100-I1)/2000)*(1+(R1-Q1)/(R1+1))+.5)
320 D2=100*INT(M2*(100-I2)/2000+.5):F1=5*M1/6:A1=Z
330 FOR U=1 TO 4:PRINT:NEXT U
340 PRINT CHR$(26):PRINT:PRINT:PRINT "THIS IS THE BATTLE OF";
350 GOSUB 1050
360 PRINT " ","CONFEDERACY","  UNION"
370 PRINT "MEN"," ";INT(M1*(1+(P1-T1)/(M3+1)))," ";
380 PRINT INT(M2*(1+(P2-T2)/(M4+1)))
390 PRINT "MONEY","$";D1,"$";D2
400 PRINT "INFLATION"," ";I1+15;"%",
410 PRINT " "; I2;"%"
420 PRINT
430 PRINT "APPORTION YOUR MONEY AMONG FOOD, SALARIES & AMMUNITION."
440 PRINT
450 INPUT "HOW MUCH DO YOU WANT TO SPEND FOR FOOD";F:IF F<0 THEN 1000
460 INPUT "HOW MUCH DO YOU WISH TO SPEND FOR SALARIES";S:

    IF S<0 THEN 1000
470 INPUT "HOW MUCH DO YOU WISH TO SPEND FOR AMMUNITION";B:

    IF B<0 THEN 1000
480 PRINT
490 IF F+S+B>D1 THEN PRINT "THINK AGAIN! YOU ONLY HAVE $";D1:GOTO 450
500 O=((2*F^2+S^2)/F1^2+1)
510 IF O>=10 THEN PRINT "MORALE IS HIGH.":GOTO 540
520 IF O>=5 THEN PRINT "MORALE IS FAIR.":GOTO 540
530 PRINT "MORALE IS POOR."
540 IF M=3 THEN PRINT "YOU ARE ON THE OFFENSIVE.":GOTO 570
550 IF M=1 THEN PRINT "YOU ARE ON THE DEFENSIVE.":GOTO 570
560 PRINT "BOTH SIDES ARE ON THE OFFENSIVE."
570 PRINT
580 PRINT "  DEFENSIVE                OFFENSIVE"
590 PRINT "  ---------                ---------"
600 PRINT "1) ARTILLERY ATTACK      1) ARTILLERY ATTACK"
610 PRINT "2) FORTIF VS FRONTAL     2) FRONTAL ATTACK"
620 PRINT "3) FORTIF VS FLANKING    3) FLANKING MANEUVERS"
630 PRINT "4) FALLING BACK          4) ENCIRCLEMENT":PRINT
640 INPUT "YOUR STRATEGY";Y:IF Y=5 THEN 1780
650 IF ABS(Y-3)>=3 THEN PRINT "PLEASE USE THE OTHER SET OF STRATEGIES!":

    GOTO 570
660 PRINT
670 PRINT " ", "CONFEDERACY", "UNION"
680 C5=(2*C1/5)*(1+1/(2*(ABS(INT(4*RND(1)+1)-Y)+1)))
690 C5=INT(C5*(1+1/O)*(1.28+F1/(B+1))+.5)
700 IF C5+100/O<M1*(1+(P1-T1)/(M3+1)) THEN 720
710 C5=INT(13*M1/20*(1+(P1-T1)/(M3+1))):E=7*C5/13:U=1:GOTO 730
720 E= 100/O
730 PRINT "CASUALTIES",C5,INT(17*C2*C1/(C5+20)+.5)
740 PRINT "DESERTIONS",INT(E),INT(5*O):PRINT:IF C5-C1>=0 THEN 770
750 PRINT "YOUR CASUALTIES WERE";INT(100*(C1-C5)/C1+.5);"% LESS THAN "
760 GOTO 780
770 PRINT "YOUR CASUALTIES WERE";INT(100*(C5-C1)/C1+.5);"% MORE THAN "
780 PRINT "THE ACTUAL CASUALTIES AT";:A1=1:GOSUB 1050:IF U=1 THEN 800
790 IF C5 + E<17*C2*C1/(C5*20)+5*O THEN 810
800 PRINT "        YOU LOSE ";:L=L+1:GOTO 820
810 PRINT "YOU WIN ";:W=W+1
820 GOSUB 1050:IF W=8 THEN 1790
830 T1=T1+C5+E:T2=T2+17*C2*C1/(C5*20)+5*O:P1=P1+C1:P2=P2+C2
840 Q1=Q1+(F+S+B):R1=R1+M1*(100-T1)/20:M3=M3+M1:M4=M4+M2
850 IF A=14 THEN 1800 ELSE 300
860 DATA 18000,18500,1967,2708,1,1,0
870 DATA 40000,44894,10699,13047,3,2,0
880 DATA 95000,115000,20614,15849,3,3,0
890 DATA 54000,63000,10000,14000,2,4,0
900 DATA 40000,50000,10000,12000,3,5,0
910 DATA 75000,120000,5377,12653,1,6,0
920 DATA 38000,45000,11000,12000,1,7,0
930 DATA 32000,90000,13000,17197,2,8,0
940 DATA 50000,70000,12000,19000,1,9,0
950 DATA 72500,85000,20000,23000,3,10,0
960 DATA 66000,60000,18000,16000,2,11,0
970 DATA 37000,60000,6700,5800,2,12,0
980 DATA 62000,110000,17723,18000,2,13,0
990 DATA 65000,100000,8500,3700,1,14,0
1000 PRINT "GO TO JAIL."
1010 PRINT "GO DIRECTLY TO JAIL."
1020 PRINT "DO NOT PASS GO."
1030 PRINT "DO NOT COLLECT $200."
1040 GOTO 330
1050 IF A<>1 THEN 1110
1060 PRINT " BULL RUN.":IF A1=1 THEN 1750
1070 PRINT "JULY 21,1861   GEN. BEAUREGARD COMMANDING THE SOUTH MET THE"
1080 PRINT "UNION FORCES WITH GEN. MC DOWELL IN A PREMATURE BATTLE AT BULL"
1090 PRINT "RUN.  GEN. JACKSON HELPED PUSH BACK THE UNION ATTACK."
1100 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1110 IF A<>2 THEN 1160
1120 PRINT " SHILOH.":IF A1=1 THEN 1750
1130 PRINT "APRIL 6-7, 1862   THE CONFEDERATE SURPRISE ATTACK AT SHILOH"
1140 PRINT "FAILS DUE TO POOR ORGANIZATION."
1150 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1160 IF A<>3 THEN 1220
1170 PRINT " SEVEN DAYS.":IF A1=1 THEN 1750
1180 PRINT "JUNE 25-JULY 1, 1862   GENERAL LEE (CSA) UPHELD THE OFFENSIVE"
1190 PRINT "THROUGHOUT THE BATTLE AND FORCED GEN. MC CLELLAN AND THE UNION"
1200 PRINT "FORCES AWAY FROM RICHMOND."
1210 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1220 IF A<>4 THEN 1270
1230 PRINT " THE SECOND BULL RUN.":IF A1=1 THEN 1750
1240 PRINT "AUG 29-30, 1862   THE COMBINED CONFEDERATE FORCES UNDER LEE AND"
1250 PRINT "JACKSON DROVE THE UNION FORCES BACK INTO WASHINGTON."
1260 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1270 IF A<>5 THEN 1320
1280 PRINT " ANTIETAM.":IF A1=1 THEN 1750
1290 PRINT "SEPT 17, 1862   THE SOUTH FAILED TO INCORPORATE MARYLAND INTO"
1300 PRINT "THE CONFEDERACY."
1310 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1320 IF A<>6 THEN 1370
1330 PRINT " FREDERICKSBURG.":IF A1=1 THEN 1750
1340 PRINT "DEC 13, 1862   THE CONFEDERACY UNDER LEE SUCCESSFULLY REPULSED"
1350 PRINT "AN ATTACK BY THE UNION UNDER GEN. BURNSIDE."
1360 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1370 IF A<>7 THEN 1410
1380 PRINT " MURFREESBORO.":IF A1=1 THEN 1750
1390 PRINT "DEC 31, 1862   THE SOUTH UNDER GEN. BRAGG WON A CLOSE BATTLE."
1400 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1410 IF A<>8 THEN 1460
1420 PRINT " CHANCELLORSVILLE.":IF A1=1 THEN 1750
1430 PRINT "MAY 1-6, 1863   THE SOUTH HAD A COSTLY VICTORY AND LOST ONE"
1440 PRINT "OF THEIR GREATEST GENERALS, 'STONEWALL' JACKSON."
1450 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1460 IF A<>9 THEN 1510
1470 PRINT " VICKSBURG.":IF A1=1 THEN 1750
1480 PRINT "JULY 4, 1863   VICKSBURG WAS A COSTLY DEFEAT FOR THE SOUTH"
1490 PRINT "BECAUSE IT GAVE THE UNION ACCESS TO THE MISSISSIPPI."
1500 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1510 IF A<>10 THEN 1560
1520 PRINT " GETTYSBURG.":IF A1=1 THEN 1750
1530 PRINT "JUNE 30, 1863   A SOUTHERN MISTAKE BY GEN. LEE AT GETTYSBURG"
1540 PRINT "COST THEM ONE OF THE MOST CRITICAL BATTLES OF THE WAR."
1550 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1560 IF A<>11 THEN 1610
1570 PRINT " CHICKAMAUGA.":IF A1=1 THEN 1750
1580 PRINT "NOV 25, 1863   AFTER THE SOUTH HAD SIEGED GEN. ROSENCRANS'"
1590 PRINT "ARMY FOR THREE MONTHS, GEN. GRANT BROKE THE SIEGE."
1600 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1610 IF A<>12 THEN 1660
1620 PRINT " CHATTANOOGA.":IF A1=1 THEN 1750
1630 PRINT "SEPT 15, 1863   CONFUSION IN A FOREST NEAR CHICKAMAUGA LED"
1640 PRINT "TO A COSTLY SOUTHERN VICTORY."
1650 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1660 IF A<>13 THEN 1710
1670 PRINT " SPOTSYLVANIA.":IF A1=1 THEN 1750
1680 PRINT "MAY 5, 1864   GRANT'S PLAN TO KEEP LEE ISOLATED BEGAN TO FAIL"
1690 PRINT "HERE, AND CONTINUED AT COLD HARBOR AND PETERSBURG."
1700 PRINT:PRINT:PRINT:PRINT:GOTO 1750
1710 PRINT " ATLANTA.":IF A1=1 THEN 1750
1720 PRINT "AUGUST, 1864   SHERMAN AND THREE VETERAN ARMIES CONVERGED ON"
1730 PRINT "ATLANTA AND DEALT THE DEATH BLOW TO THE CONFEDERACY."
1740 PRINT:PRINT:PRINT:PRINT
1750 PRINT:LINE INPUT "PRESS RETURN TO CONTINUE >";C$
1760 PRINT:RETURN
1770 RETURN
1780 PRINT "THE CONFEDERACY HAS SURRENDERED.":GOTO 1800
1790 PRINT "THE UNION HAS SURRENDERED."
1800 PRINT
1810 PRINT "YOU HAVE WON"; W;"BATTLES AND LOST";L;"BATTLES."
1820 IF Y=5 OR W<=L THEN 1840
1830 PRINT "THE CONFEDERACY HAS WON THE WAR.":GOTO 1850
1840 PRINT "THE UNION HAS WON THE WAR."
1850 FOR I=1 TO 500:NEXT I:FILES
1860 END
 CONFEDERACY HAS WON THE WAR.":GOTO 1850
1840 PRINT "THE UNION HAS WON THE WAR."
1850 FOR I=1 TO 500:NEXT I:FIL