Dale's Home Page

Dale’s Atari 800 Games › Stan Ockers

Doggies

By Stan Ockers, in the ACE newsletter of January 1982.

Play Doggies

Stan’s write-up

This one's for Johnny. At 1 1/2 years old he can't control the joystick yet but he can push the button and he loves doggies. It's also hard enough to drive adults nuts. I know it can be done in 15 moves but I haven't done it yet and I refuse to peek at the answer.

Changing large numbers of characters in the character set would have been extremely difficult without an excellent program by Alan Zett in the Oct. '81 issue of Softside. That program will allow you to create a new character set and save it on tape for insertion into your program. I highly recommend it.

The bone is a player missile. As you can probably tell by the smoothness of movement, the moving is done during the vertical blank period as outlined in last month's article. The response to the trigger seems a little sluggish because of the time to go through the main loop. This could be fixed by putting trigger detection in the VBI routine where it would be checked every 1/60 sec. A location in page 6 could be set and checked later by the Basic program.

A major subroutine in the program occurs at lines 1000-1020. It prints the string DOG$ at position X,Y. DOG$ is determined by LINE. By changing LINE you can change the printed figure.

The position of the dogs is stored in P$ (1's for light dogs, 2's for dark). The desired final position is represented in the string F$ and a comparison of the two strings at line 180 determines if the end has been reached.

I've made liberal use of remarks but all remarks can be omitted if you are typing in the program. I'm not too pleased with the barking sound but I didn't want to spend a lot of time working on it. What is needed is a program that allows selecting pitch and maybe volume contours by using the joystick. I'm presently working on a program to do this.

Space could have been saved by simply defining strings like P$, F$ and ZZ$ using control characters etc. Control characters and inverse characters don't print well on a printer however, so I've chosen instead to fill them from data statements.

—Stan Ockers

Stan Ockers' Doggies write-up in the January 1982 ACE newsletter (ACE Volume 1)
As printed: page 6 of the January 1982 issue.

The program

The listing, “DOGGIES by Stan Ockers”, is on pages 6, 7 of the issue. The game page runs it line by line in an emulated Atari 800, just as typed in.

Where this copy came from: Transcribed by hand from Kay Savetz's scan of ACE Volume 1 (pages 153-154; there is no typed-in copy). The printer couldn't show inverse characters, so the dark doggies' shapes (lines 951-962, “all are inv. char.”) are entered as inverse here. The dogs drawn from the character data match Stan's printed descriptions pose for pose. This is Stan's own original; Garry Francis's 1983 reworking is “Doggies Revisited”.

Show the listing
2 REM ****************
4 REM ** DOGGIES **
6 REM ** S. OCKERS **
7 REM ** 11/81 **
8 REM ****************
9 REM all remarks may be deleted
10 DIM DOG$(6),P$(7),F$(7),ZZ$(32),PI$(6)
11 REM ** PITCH CONTOUR FOR BARK **
12 FOR I=1 TO 6:READ A:PI$(I)=CHR$(A):NEXT I
13 DATA 97,109,97,9,5,5
25 REM ** FILL MOVE ROUTINE **
30 FOR I=1 TO 32:READ A:ZZ$(I)=CHR$(A):NEXT I
32 DATA 104,104,133,204,104,133,203,104,133,206,104,133,205,162,4,160,0
33 DATA 177,203,145,205,136,208,249,230,204,230,206,202,208,240,96
38 OPEN #1,4,0,"K:":GRAPHICS 18:POSITION 3,5:? #6;"INSTRUCTIONS?":GET #1,A:IF A=89 THEN GOSUB 2010
39 REM ** CHANGE CHARACTER SET **
40 GOSUB 32000
44 GRAPHICS 18:POKE 756,PEEK(106)+1
50 REM ** PLAYER MISSILE GRAPHICS **
60 A=PEEK(106)-7:POKE 54279,A:PM=256*A:POKE 559,46:POKE 53277,3:X=120:POKE 53248,X:POKE 209,X:POKE 53256,1
70 RESTORE 80:FOR I=PM+512 TO PM+640:POKE I,0:NEXT I:POKE 704,200:Y=90
75 FOR I=PM+512+Y TO PM+514+Y:READ A:POKE I,A:NEXT I
80 DATA 195,255,195
85 REM ** PAGE 6 VBI ROUTINE **
90 RESTORE 96:FOR I=1536 TO 1570:READ A:POKE I,A:NEXT I:A=USR(1536)
96 DATA 104,160,10,162,6,169,7,76,92,228,173,0,211,72,41,8,208,2,230,209,104,41,4,208,2,198,209,165,209,141
98 DATA 0,208,76,98,228
100 REM ** DRAW INITIAL DOGS **
105 REM ** FILL POSITION & FINISH STRINGS **
106 FOR I=1 TO 7:READ A:P$(I)=CHR$(A):NEXT I
107 FOR I=1 TO 7:READ A:F$(I)=CHR$(A):NEXT I
108 DATA 1,1,1,0,2,2,2,2,2,2,0,1,1,1
110 FOR C=1 TO 7:GOSUB 1060:IF A=0 THEN NEXT C
120 GOSUB 1010:NEXT C
150 REM ** INITIALIZE MOVE **
160 MOVE=0:POSITION 13,4:? #6;"MOVE"
170 REM ** CK FOR COMPLETE **
180 IF P$=F$ THEN POSITION 0,3:? #6;"GOOD GOING":GOTO 450
186 REM ** CK TRIGGER **
188 IF STRIG(0)=1 THEN 450
190 REM ** CK CHOICE SKIP IF BLANK **
200 GOSUB 1210:IF A=0 THEN 450
210 REM ** IF ILLEGAL, SHAKE HEAD, SKIP **
220 IF C<B-2 OR C>B+2 THEN GOSUB 1110:GOTO 450
230 REM ** BARK AND HOP **
240 GOSUB 1410:GOSUB 1510
250 REM ** ALL DOGS FACE CHOICE **
260 SAV=C:FOR C=1 TO 7:GOSUB 1710:NEXT C:C=SAV:GOSUB 1060
270 REM ** BARK, HOP & TURN BACKWARDS **
280 GOSUB 1410:GOSUB 1510:LINE=LINE+8:GOSUB 1660
285 REM ** INTO THE SUNSET **
290 LINE=LINE+2:GOSUB 1010:GOSUB 1910
300 LINE=LINE+1:GOSUB 1010:GOSUB 1910
320 REM ** SWITCH CHOICE AND BLANK **
330 REM blank dog at Choice
340 X=(C-1)*3:POSITION X,6:? #6;"  ":POSITION X,7:? #6;"  ":POSITION X,8:? #6;"  "
360 REM ** Switch pos. in pos. string **
370 P$(B,B)=P$(C,C):P$(C,C)=CHR$(0):C=B
380 REM ** PUT DOG WHERE BLANK WAS **
382 GOSUB 1060:LINE=LINE+11:GOSUB 1010:GOSUB 1910
384 LINE=LINE-1:GOSUB 1010:GOSUB 1910
390 GOSUB 1060:GOSUB 1610:GOSUB 1510
400 REM ** UPDATE MOVE **
410 MOVE=MOVE+1:POSITION 15,2:? #6;MOVE
440 REM ** MAKE A RANDOM DOG MOVE **
450 GOSUB 1310:GOSUB 1410+100*INT(RND(0)*3)
460 REM ** LOOP BACK **
470 POKE 77,0:POKE 53279,8:IF PEEK(53279)=6 THEN 44
480 GOTO 180
900 REM ** DOG #1 POSES **
901 DATA '()*%& :REM for. no tail
902 DATA '()\%& :REM for. tail right
903 DATA '([*%& :REM for. tail left
904 DATA '([*%- :REM for. rt. leg up
905 DATA '()\+& :REM for. lt. leg up
906 DATA !"#$%& :REM bark no tail
907 DATA ./:;%& :REM face rt.
908 DATA XY<=%& :REM face lt.
909 DATA >@Z^+& :REM bk. lt. leg up
910 DATA >@]_%- :REM bk. rt. leg up
911 DATA PQRS   :REM bk. med ht.
912 DATA TU     :REM bk. small ht.
950 REM ** DOG #2 POSES (all are inv. char.) **
951 DATA {inv}'()*%&{/inv} :REM for. no tail
952 DATA {inv}'()\%&{/inv} :REM for. tail right
953 DATA {inv}'([*%&{/inv} :REM for. tail left
954 DATA {inv}'([*%-{/inv} :REM for. rt. leg up
955 DATA {inv}'()\+&{/inv} :REM for. lt. leg up
956 DATA {inv}!"#$%&{/inv} :REM bark no tail
957 DATA {inv}./:;%&{/inv} :REM face rt.
958 DATA {inv}XY<=%&{/inv} :REM face lt.
959 DATA {inv}>@Z^+&{/inv} :REM bk. lt. leg up
960 DATA {inv}>@]_%-{/inv} :REM bk. rt. leg up
961 DATA {inv}PQRS{/inv}   :REM bk. med ht.
962 DATA {inv}TU{/inv}     :REM bk. small ht.
1000 REM ** PRINT DOG SUBROUTINE **
1010 RESTORE LINE:READ DOG$
1020 POSITION X,Y:? #6;DOG$(1,2):POSITION X,Y+1:? #6;DOG$(3,4):POSITION X,Y+2:? #6;DOG$(5,6):RETURN
1050 REM ** SET UP FOR CHOICE C **
1060 A=ASC(P$(C))
1070 IF A=1 THEN LINE=901
1080 IF A=2 THEN LINE=951
1090 X=(C-1)*3:Y=6:RETURN
1100 REM ** SHAKE HEAD NO **
1110 IF A=0 THEN RETURN
1140 FOR I=1 TO 3:GOSUB 1190:LINE=LINE+6:GOSUB 1190:LINE=LINE-6:GOSUB 1190
1145 LINE=LINE+7:GOSUB 1190:LINE=LINE-7:GOSUB 1190
1150 NEXT I:RETURN
1190 FOR J=1 TO 3:NEXT J:GOSUB 1010:RETURN
1200 REM ** DET. CHOICE & BLANK **
1210 C=INT((PEEK(209)/24)-0.65):IF C<1 THEN C=1
1220 IF C>7 THEN C=7
1230 B=0
1240 B=B+1:IF ASC(P$(B))<>0 THEN 1240
1250 GOSUB 1060:RETURN
1300 REM ** CHOOSE A RANDOM DOG **
1310 C=INT(RND(0)*7+1):GOSUB 1060:RETURN
1400 REM ** BARK CHOICE **
1410 IF A=0 THEN RETURN
1440 GOSUB 1010:LINE=LINE+5:GOSUB 1010:GOSUB 1810:LINE=LINE-5:GOSUB 1010:RETURN
1500 REM ** WAG TAIL **
1510 IF A=0 THEN RETURN
1540 LINE=LINE+1:GOSUB 1560:LINE=LINE-1:GOSUB 1010:RETURN
1560 FOR I=1 TO 3:LINE=LINE+1:GOSUB 1590:LINE=LINE-1:GOSUB 1590:NEXT I:RETURN
1590 FOR J=1 TO 3:NEXT J:GOSUB 1010:RETURN
1600 REM ** HOP **
1610 IF A=0 THEN RETURN
1620 LINE=LINE+3:GOSUB 1660:LINE=LINE-3:GOSUB 1010:RETURN
1660 FOR I=1 TO 3:SOUND 0,6,13,8:SOUND 1,0,0,0:LINE=LINE+1:GOSUB 1590:LINE=LINE-1:SOUND 0,0,0,0:SOUND 1,11,13,8
1670 GOSUB 1590:NEXT I:RETURN
1700 REM ** TURN TO FACE CHOICE **
1710 IF C=SAV THEN RETURN
1720 GOSUB 1060:IF A=0 THEN RETURN
1730 IF A=1 AND C<SAV THEN LINE=907
1740 IF A=2 AND C<SAV THEN LINE=957
1750 IF A=1 AND C>SAV THEN LINE=908
1760 IF A=2 AND C>SAV THEN LINE=958
1770 GOSUB 1010:RETURN
1800 REM ** BARK SOUND SUBR. **
1810 FOR I=1 TO 6:SOUND 0,ASC(PI$(I)),12,14-I*2
1820 SOUND 1,ASC(PI$(I)),14,I*2
1830 NEXT I:SOUND 0,0,0,0:SOUND 1,0,0,0:RETURN
1900 REM ** FOOTSTEPS SOUND **
1910 FOR I=1 TO 4:SOUND 0,6,13,8:SOUND 1,0,0,0:FOR J=1 TO 12:NEXT J
1920 SOUND 0,0,0,0:SOUND 1,11,13,8:FOR J=1 TO 12:NEXT J:NEXT I:RETURN
2000 REM ** INSTRUCTIONS **
2010 GRAPHICS 0:POKE 752,1:POSITION 15,2:? "* DOGGIES *":? :? "Move the light colored doggies where"
2020 ? "the dark ones are and the dark ones":? "where the light ones are."
2030 ? :? "To make a doggie move put the bone":? "under him and push the red button."
2040 ? :? "Doggies move to the blank space but":? "only if it is next to them or at":? "most one doggie away."
2050 ? :? "It can be done in 15 moves! See how":? "many it takes you."
2060 ? :? "Press the START key to begin or to":? "start over at any time."
2070 POKE 53279,8
2080 IF PEEK(53279)<>6 THEN 2080
2090 RETURN
31900 REM ** CHANGE CHARACTER SET **
31910 REM ** SEE ARTICLE IN OCT. '81 SOFTSIDE BY A. ZETT **
32000 POKE 106,PEEK(106)-5:GRAPHICS 0:START=(PEEK(106)+1)*256:POKE 756,START/256:POKE 752,1
32010 ? "INITIALIZING . . ."
32020 A=USR(ADR(ZZ$),57344,START):RESTORE 32100
32030 READ X:IF X=-1 THEN RESTORE :RETURN
32040 FOR Y=0 TO 7:READ Z:POKE X+Y+START,Z:NEXT Y:GOTO 32030
32100 DATA 8,7,15,31,61,109,111,110,111
32101 DATA 16,224,240,248,188,182,246,118,246
32102 DATA 24,12,12,7,3,3,7,15,31
32103 DATA 32,48,48,224,192,192,224,240,248
32104 DATA 40,31,31,31,31,31,24,248,248
32105 DATA 48,248,248,248,248,248,24,31,31
32106 DATA 56,0,7,31,63,125,237,239,206
32107 DATA 64,0,224,248,252,190,183,247,115
32108 DATA 72,15,12,15,7,3,7,15,31
32109 DATA 80,240,48,240,224,192,224,240,248
32110 DATA 88,31,31,31,31,27,248,248,0
32111 DATA 104,248,248,248,248,216,31,31,0
32112 DATA 112,0,7,15,31,63,63,55,55
32113 DATA 120,0,128,192,192,64,127,255,255
32114 DATA 208,55,7,7,3,3,7,15,31
32115 DATA 216,254,224,254,252,192,224,240,248
32116 DATA 224,127,7,127,63,3,7,15,31
32117 DATA 232,236,224,224,192,192,224,240,248
32118 DATA 240,0,7,31,63,127,239,239,207
32119 DATA 256,0,224,248,252,254,247,247,243
32120 DATA 384,1,7,15,11,3,1,3,7
32121 DATA 392,128,224,240,208,192,128,192,224
32122 DATA 400,7,7,7,7,7,4,28,0
32123 DATA 408,224,224,224,224,224,32,56,0
32124 DATA 416,3,3,1,3,3,3,3,6
32125 DATA 424,192,192,128,192,192,192,192,96
32126 DATA 448,0,1,3,3,2,254,255,255
32127 DATA 456,0,224,240,248,252,252,236,236
32128 DATA 464,15,15,15,7,3,7,15,31
32129 DATA 472,15,12,15,71,67,71,47,31
32130 DATA 480,240,48,240,226,194,226,244,248
32131 DATA 488,15,15,15,71,67,71,47,31
32132 DATA 496,240,240,240,226,194,226,244,248
32133 DATA 504,240,240,240,224,192,224,240,248
32134 DATA -1

Play Doggies