Thursday 14 January 2016

January 2016 Retrochallenge 5: Mini Pacman Atari Challenge

There was a 5 line Basic mini game for the Atari 8-bit demoed on Youtube:


The original was written by Robin Edwards in 1987 and published in Atari User in its September edition. I created an MC-10 version back in December and have now ported the code to Coco and Dragon). It shows how the TRS-80 MC-10 (and Coco and Dragon) could implement the program in 5 lines contrary to what RPKVids suggests in the video. He says about mid way through the video:
"I'm not sure if something like this could be done with such a small amount of code on most of the other old school computers..."
Challenge accepted and met (I think). You be the judge.


Thanks to RPKVids for the Retrocomputing inspiration. Here's the Dragon/Coco version of the code:

1 POKE65495,0:INPUT"LEVEL (1-9)";E:CLS0:M=1024:FORY=0TO9:FORX=0TO9:POKEM+X+Y*32,46:NEXT:NEXT:X=0:Y=0:A=9:B=9:W$(1)="YOU WIN!!"
2 P=M+X+Y*32:G=M+A+B*32:C=PEEK(P):D=PEEK(G):POKEP,124:POKEG,98:S=0:IF(PEEK(344)AND PEEK(343)AND PEEK(342)AND PEEK(341))<>255THENS=PEEK(135)
3 Q=(S=8AND X>0):Q=Q-(S=9AND X<9):R=(S=94AND Y>0):R=R-(S=10AND Y<9):X=X+Q:Y=Y+R:SOUND1,1:IFC=46THENSOUND100,1:C=32:T=T+1:PRINT@11,T;
4 P=M+X-Q+(Y-R)*32:G=M+A+B*32:POKEP,C:POKEG,D:IFRND(11)<=E THENA=A-(X>A)+(X<A):B=B-(B<Y)+(B>Y)
5 ON-((X=A)+(Y=B)<>-2)GOTO2:PRINT@353,"gAmE oVeR";:PRINT@385,W$(-(T=100));:PRINT@416,;:RUN

No comments:

Post a Comment