10 REM DUCK! - A game by Peter H. Kelly M.D., published
20 REM in the April/May 1983 issue of THE PORTABLE COMPANION
30 REM by Osborne Computer Corporation. This game is written for
40 REM the Osborne 1, although with modification it could easily
50 REM run on other computers running Microsoft Basic.
60 REM Typed up and slightly modified (see lines 1490-1500)
70 REM by David A. Basskin, Toronto, Ontario, Canada.
100 PRINT CHR$(26)
110 PRINT:PRINT:PRINT TAB(25) "DUCK!"
120 PRINT:PRINT:PRINT
130 PRINT:PRINT:PRINT:INPUT "     Do you want instructions (Y/N)";I$
140 IF I$ = "N" OR I$ = "n" GOTO 321
150 PRINT CHR$(26)
160 PRINT "The object of this game is to make the most points"
170 PRINT "shooting down ducks without yourself getting dive-"
180 PRINT "bombed or blown up. Points are awarded according to the"
190 PRINT "difficulty and angle of the shot; only four con-"
200 PRINT "secutive shots at the same time are allowed. If"
210 PRINT "If you miss, the duck may bomb you or your protec-"
220 PRINT "ting trees. If more than 5 trees are lost from one"
230 PRINT "side of your blind, you are liable to be dive-"
240 PRINT "bombed from that side; you can survive provided"
250 PRINT "your ammunition is not hit. The duck can also hit"
260 PRINT "your ammunition directly with an overhead bomb."
270 PRINT "POINTS: Shot ducks score from 10 to 50 points."
280 PRINT "Five bonus points are scored for each surviving"
290 PRINT "tree as long as at least one duck was hit. 20"
300 PRINT "points are scored for trees that survive through"
310 PRINT "an entire game, and zero bonus points are regis-"
320 PRINT "tered if no ducks were hit."
321 PRINT:PRINT:RANDOMIZE
322 DIM L(22)
323 FOR Y=1 TO 22
324 READ L(Y)
340 NEXT Y
350 PRINT CHR$(26)
360 M=0:N=0:Q=11:Z=11
370 D=INT(RND(1)*4)
380 PRINT CHR$(27)+"=";(CHR$(55))(CHR$(32));
390 FOR I=1 TO 25
400 PRINT CHR$(27)+")";CHR$(141);CHR$(32);
410 NEXT
420 PRINT "  ";
430 FOR I=1 TO 25
440 PRINT CHR$(139);CHR$(32);
450 NEXT
460 PRINT
470 FOR J=1 TO 2
480 FOR I=1 TO 50
490 PRINT CHR$(150);
500 NEXT
510 PRINT
520 NEXT
530 PRINT CHR$(27)+"(";
540 PRINT CHR$(27)+"=";(CHR$(52))(CHR$(54));CHR$(32);CHR$(150);CHR$(150);CHR$(150);CHR$(150);
550 PRINT CHR$(27)+"=";(CHR$(51))(CHR$(54));CHR$(32);CHR$(128);CHR$(128);CHR$(128);CHR$(128);
560 PRINT CHR$(27)+"=";(CHR$(50))(CHR$(55));CHR$(138);CHR$(136);CHR$(138);CHR$(136);
570 X=0
580 PRINT CHR$(27)+"=";(CHR$(32))(CHR$(33));"Fire at angle 1 to 9"
590 FOR Y=0 TO 52 STEP 1
600 PRINT CHR$(27)+"=";(CHR$(33+X))(CHR$(32+Y));CHR$(32);CHR$(32);CHR$(152);CHR$(136)
610 IF X<18 GOTO 640
620 IF X=18 AND Y=23 THEN X=0:Y=0:GOTO 590
630 IF X=19 AND Y=23 GOTO 1390
640 LET A$=INKEY$:IF VAL(A$)=0 GOTO 820
650 IF VAL(A$)=H THEN C2=C2+1
660 IF VAL(A$)<>H AND VAL(A$)>0  THEN C2=0
670 IF C2>3 GOTO 820
680 H=VAL(A$)
690 V=V+1
700 PRINT CHR$(27)+"=";(CHR$(32))(CHR$(32));100-V;" Bullets Remaining"
710 A=6*VAL(A$)-30
720 S=X:T=Y
730 FOR X=0 TO -16 STEP -1
740 PRINT CHR$(27)+"=";(CHR$(49+X))(CHR$(57+INT(A*ABS(X)/10)));"*"
750 PRINT CHR$(27)+"=";(CHR$(49+X))(CHR$(57+INT(A*ABS(X)/10)));" "
760 IF S<>X+16 GOTO 790
770 IF T=INT(22+A*ABS(X)/10) OR T=INT(23+A*ABS(X)/10) THEN GOTO 1120
780 IF V=100 GOTO 1400
790 NEXT X
800 GOSUB 1210
810 X=S:Y=T
820 NEXT Y
830 PRINT CHR$(27)+"=";(CHR$(33+X))(CHR$(86));CHR$(32);CHR$(32);
840 X=INT(RND(1)*(15+N))
850 FOR Y=52 TO 0 STEP -1
860 PRINT CHR$(27)+"=";(CHR$(33+X))(CHR$(32+Y));CHR$(138);CHR$(152);CHR$(32);CHR$(32)
870 IF X<18 GOTO 900
880 IF X=18 AND Y=23 THEN X=0:Y=0:GOTO 590
890 IF X=19 AND Y=23 GOTO 1390
900 LET A$=INKEY$:IF VAL(A$)=0 GOTO 1080
910 IF VAL(A$)=H THEN C2=C2+1
920 IF VAL(A$)<>H AND VAL(A$)>0 THEN C2=0
930 IF C2>3 GOTO 1080
940 H=VAL(A$)
950 V=V+1
960 PRINT CHR$(27)+"=";(CHR$(32))(CHR$(32));100-V;" Bullets Remaining "
970 A=6*VAL(A$)-30
980 S=X:T=Y
990 FOR X=0 TO -16 STEP -1
1000 PRINT CHR$(27)+"=";(CHR$(49+X))(CHR$(57+INT(A*ABS(X)/10)));"*"
1010 PRINT CHR$(27)+"=";(CHR$(49+X))(CHR$(57+INT(A*ABS(X)/10)));" "
1020 IF S<>X+16 GOTO 1050
1030 IF T=INT(25+A*ABS(X)/10) OR T=INT(24+A*ABS(X)/10) THEN GOTO 1120
1040 IF V=100 GOTO 1400
1050 NEXT X
1060 GOSUB 1210
1070 X=S:Y=T
1080 NEXT Y
1090 PRINT CHR$(27)+"=";(CHR$(X+33))(CHR$(32));CHR$(32);CHR$(32);CHR$(32);CHR$(32)
1100 X=INT(RND(1)*15+C)
1110 GOTO 590
1120 PRINT CHR$(7)
1130 P=P+ABS(VAL(A$)-5)*10+10
1140 PRINT CHR$(27)+"=";(CHR$(32))(CHR$(69));P;"Points"
1150 IF V=100 GOTO 1400
1160 FOR G=0 TO 3
1170 PRINT CHR$(27)+"=";(CHR$(S+33))(CHR$(32+13*G));"       ";
1180 NEXT G
1190 X=0:Y=0
1200 GOTO 590
1210 W=INT(RND(1)*3)
1220 IF W=>1 THEN RETURN
1230 FOR M=0 TO 19-S STEP 1
1240 FOR E=1 TO 20
1250 NEXT E
1260 PRINT CHR$(27)+"=";(CHR$(34+M+S))(CHR$(34+T));CHR$(141)
1270 PRINT CHR$(27)+"=";(CHR$(34+M+S))(CHR$(34+T))" "
1280 IF T=D+21 AND M=19-S THEN GOSUB 1390
1290 NEXT
1300 FOR B=1 TO 22
1310 IF L(B)=T+2 THEN L(B)=-1:GOTO 1340
1320 NEXT B
1330 GOTO 1380
1340 IF T+2<21 THEN Q=Q-1
1350 IF T+2>27 THEN Z=Z-1
1360 IF Q<7 THEN C=5:PRINT CHR$(27)+"=";(CHR$(32))(CHR$(59))"DUCK !"
1370 IF Z<7 THEN N=5:PRINT CHR$(27)+"=";(CHR$(32))(CHR$(59))"DUCK !"
1380 RETURN
1390 GOSUB 1520
1400 PRINT CHR$(26)
1410 PRINT TAB(20)"GAME OVER"
1420 PRINT:PRINT:PRINT
1430 IF P=0 THEN 1440 ELSE 1460
1440 PRINT:PRINT TAB(10)"YOU BOMBED OUT -- NO POINTS SCORED!"
1450 GOTO 1494
1460 IF V=100 THEN BONUS=20 ELSE BONUS=5
1470 PRINT TAB(10)"You had "Q+Z;"trees remaining worth"
1480 PRINT:PRINT TAB(17);(Q+Z)*BONUS;" bonus points"
1490 PRINT:PRINT TAB(13)"Your score was ";P+(Q+Z)*BONUS;" points"
1494 PRINT:PRINT:INPUT "             Another game (Y/N)";G$
1495 IF G$="Y" OR G$="y" THEN GOTO 100 ELSE RUN
1500 DATA 0,2,4,6,8,10,12,14,16,18,20,28,30,32,34,36,38,40,42,44,46,48
1510 END
1520 FOR G=0 TO 21
1530 PRINT CHR$(27)+"="(CHR$(53))(CHR$(54+G));" "
1540 PRINT CHR$(27)+"="(CHR$(53))(CHR$(58-G));" "
1550 PRINT CHR$(27)+"="(CHR$(54))(CHR$(54+G/2));" "
1560 PRINT CHR$(27)+"="(CHR$(54))(CHR$(58-G/2));" "
1570 PRINT CHR$(27)+"="(CHR$(51-G))(CHR$(55));CHR$(32);CHR$(32);CHR$(32)
1580 PRINT CHR$(27)+"="(CHR$(50-G))(CHR$(55));CHR$(138);CHR$(136);CHR$(138)
1590 PRINT CHR$(27)+"="(CHR$(52-G))(CHR$(56-G));CHR$(32)
1600 PRINT CHR$(27)+"="(CHR$(51-G))(CHR$(55-G));CHR$(128)
1610 PRINT CHR$(27)+"="(CHR$(52-G))(CHR$(56+G));CHR$(32);CHR$(32)
1620 PRINT CHR$(27)+"="(CHR$(51-G))(CHR$(57+G));CHR$(128);CHR$(128)
1630 PRINT CHR$(27)+"="(CHR$(53-G))(CHR$(56+G/2));CHR$(32);CHR$(32)
1640 PRINT CHR$(27)+"="(CHR$(52-G))(CHR$(57+G/2));CHR$(150)
1650 PRINT CHR$(27)+"="(CHR$(51))(CHR$(58-G));CHR$(32)
1660 PRINT CHR$(27)+"="(CHR$(52))(CHR$(55-G));CHR$(150);CHR$(32)
1670 PRINT CHR$(27)+"="(CHR$(51))(CHR$(51+G));CHR$(32)
1680 PRINT CHR$(27)+"="(CHR$(52))(CHR$(57+G));CHR$(32);CHR$(159)
1690 NEXT G
1700 RETURN
="(CHR$(51))(CHR$(51+G));CHR$(32)
1680 PRINT CHR$(27)+"="(CHR$(52)