10 PRINT "THE UNREAL MIDEVIL WAR GAME."
20 PRINT "YOU ARE THE KING OF A CASTLE WHICH IS UNDER ATTACK BY"
30 PRINT "THE INFAMOUS PDP-11 THE HUN."
40 PRINT "AS THE KING YOU MUST DIRECT YOUR 1000 MEN TO DEFEND THE"
50 PRINT "FOUR SIDES OF THE CASTLE. ALSO YOU MUST HAVE SOME MEN"
60 PRINT "ON FIRE WATCH, TO PUT OUT FLAMING ARROWS. LET THE BATTLE"
70 PRINT "BEGIN, I WILL SHOW NO MERCY."
80 RANDOMIZE
90 LET A1=1000
100 LET A=1000
110 PRINT 
120 PRINT 
130 LET B=1
140 PRINT "BATTLE NUMBER "B\LET B=B+1
150 PRINT "HOW MANY MEN WILL DEFEND THE NORTH WALL?"
160 INPUT N
170 IF N>A THEN 1460 
180 IF A<10 THEN 200 
190 IF A/15>N THEN 1430 
200 PRINT "SOUTH WALL ("A-N"LEFT)"
210 INPUT S
220 IF (S+N)>A THEN 1460 
230 IF A<10 THEN 250 
240 IF A/15>S THEN 1430 
250 PRINT "EAST WALL ("A-(N+S)"LEFT)"
260 INPUT E
270 IF (E+S+N)>A THEN 1460 
280 IF A<10 THEN 300 
290 IF A/15>E THEN 1430 
300 PRINT "WEST WALL ("A-(N+S+E)"LEFT)"
310 INPUT W
320 IF (S+N+E+W)>A THEN 1460 
330 IF A<10 THEN 350 
340 IF A/15>W THEN 1430 
350 PRINT "HOW MANY MEN ON FIRE WATCH ("A-(N+S+E+W)"LEFT)"
360 INPUT F
370 IF (E+S+W+N+F)>A THEN 1460 
380 IF A-(E+W+N+S+F)=0 THEN 430 
390 PRINT 
400 PRINT 
410 PRINT "KING, YOU JUST THREW"A-(E+S+W+N+F)"MEN OVER THE WALL."
420 LET A=A-(A-(E+W+N+S+F))
430 PRINT 
440 PRINT "RAISE THE DRAWBRIDGE, THE HUN IS APPROACHING."
450 PRINT "WATCH OUT FOR FLAMING ARROWS, SWISH..."
460 PRINT 
470 PRINT 
480 LET F1=A1/15\LET F1=INT(F1*RND(0))
490 IF F1>F*1.5 THEN 510 
500 GO TO 520 
510 PRINT "KING, YOUR CASTLE IS BURNING!!!"\GO TO 1410 
520 LET M1=A1-F1
530 LET N1=M1/2\LET N1=INT(N1*RND(0))
540 IF A1<10 THEN 560 
550 IF A1/15>N1 THEN 530 
560 LET S1=M1/2\LET S1=INT(S1*RND(0))
570 IF A1<10 THEN 590 
580 IF A1/15>S1 THEN 560 
590 LET E1=M1/2\LET E1=INT(E1*RND(0))
600 IF A1<10 THEN 620 
610 IF A1/15>E1 THEN 590 
620 LET W1=A1-(N1+S1+E1+F1)
630 IF A1<10 THEN 650 
640 IF A1/15>W1 THEN 530 
650 IF N1>2*N THEN 670 
660 GO TO 690 
670 PRINT "KING, YOU LOST ALL"N"MEN ON THE NORTH WALL."
680 LET A=A-N\GO TO 810 
690 IF N>2*N1 THEN 710 
700 GO TO 740 
710 PRINT "KING, YOU KILLED ALL"N1"MEN ON THE NORTH WALL."
720 LET A1=A1-N1
730 GO TO 810 
740 IF N1>N THEN 770 
750 IF N>N1 THEN 790 
760 PRINT "DRAW AT THE NORTH WALL."\GO TO 810 
770 PRINT "KING, YOU LOST"N1-N"MEN AT THE NORTH WALL."
780 LET A=A-(N1-N)\GO TO 810 
790 PRINT "KING, YOU KILLED"N-N1"MEN AT THE NORTH WALL."
800 LET A1=A1-(N-N1)
810 IF S1>2*S THEN 830 
820 GO TO 850 
830 PRINT "KING, YOU LOST ALL"S"MEN ON THE SOUTH WALL."
840 LET A=A-S\GO TO 970 
850 IF S>2*S1 THEN 870 
860 GO TO 900 
870 PRINT "KING, YOU KILLED ALL"S1"MEN ON THE SOUTH WALL."
880 LET A1=A1-S1
890 GO TO 970 
900 IF S1>S THEN 930 
910 IF S>S1 THEN 950 
920 PRINT "DRAW AT THE SOUTH WALL."\GO TO 970 
930 PRINT "KING, YOU LOST"S1-S"MEN AT THE SOUTH WALL."
940 LET A=A-(S1-S)\GO TO 970 
950 PRINT "KING, YOU KILLED"S-S1"MEN AT THE SOUTH WALL."
960 LET A1=A1-(S-S1)
970 IF E1>2*E THEN 990 
980 GO TO 1010 
990 PRINT "KING, YOU LOST ALL"E"MEN ON THE EAST WALL."
1000 LET A=A-E\GO TO 1130 
1010 IF E>2*E1 THEN 1030 
1020 GO TO 1060 
1030 PRINT "KING, YOU KILLED ALL"E1"MEN ON THE EAST WALL."
1040 LET A1=A1-E1
1050 GO TO 1130 
1060 IF E1>E THEN 1090 
1070 IF E>E1 THEN 1110 
1080 PRINT "DRAW AT THE EAST WALL."\GO TO 1130 
1090 PRINT "KING, YOU LOST"E1-E"MEN AT THE EAST WALL."
1100 LET A=A-(E1-E)\GO TO 1130 
1110 PRINT "KING, YOU KILLED"E-E1"MEN AT THE EAST WALL."
1120 LET A1=A1-(E-E1)
1130 IF W1>2*W THEN 1150 
1140 GO TO 1170 
1150 PRINT "KING, YOU LOST ALL"W"MEN ON THE WEST WALL."
1160 LET A=A-W\GO TO 1290 
1170 IF W>2*W1 THEN 1190 
1180 GO TO 1220 
1190 PRINT "KING, YOU KILLED ALL"W1"MEN ON THE WEST WALL."
1200 LET A1=A1-W1
1210 GO TO 1290 
1220 IF W1>W THEN 1250 
1230 IF W>W1 THEN 1270 
1240 PRINT "DRAW AT THE WEST WALL."\GO TO 1290 
1250 PRINT "KING, YOU LOST"W1-W"MEN AT THE WEST WALL."
1260 LET A=A-(W1-W)\GO TO 1290 
1270 PRINT "KING, YOU KILLED"W-W1"MEN AT THE WEST WALL."
1280 LET A1=A1-(W-W1)\GO TO 1290 
1290 PRINT 
1300 PRINT 
1310 PRINT "KING, YOU HAVE"A"MEN LEFT."
1320 PRINT "THE HUN HAS"A1"MEN LEFT."
1330 PRINT 
1340 PRINT 
1350 PRINT 
1360 PRINT 
1370 IF A<=0 THEN 1410 
1380 IF A1<=0 THEN 1420 
1390 GO TO 140 
1400 PRINT 
1410 PRINT "KING, YOU LOST THE WAR!!!!!!"\GO TO 1490 
1420 PRINT "KING, YOU WON THE WAR!!!"\GO TO 1490 
1430 PRINT 
1440 PRINT 
1450 PRINT "KING, YOUR DEFENSES ARE TOO UNEVEN."\GO TO 150 
1460 PRINT 
1470 PRINT 
1480 PRINT "KING, YOU ONLY HAVE"A"MEN."\GO TO 150 
1490 END
