I had my own errors in this game as well. I double checked the code twice but there's something I missed or there's something that's wrong with SourceCode 2.5, which is how I got the game on my calculator.
The first "food" generates correctly and can be "eaten." However, the second food appears as a black box instead of an "x" and, when I try to eat it the game ends and shows a score of one. I am confused because the box isn't the correct graphic and my game ends here.
Any idea why? I don't understand most of the code so this is difficult to me.
Here's the code:
:AxesOff:FnOff
:ClrDraw
:ZStandard
:104→Xmax
:‾72→Ymin
:ZInteger
:Line(94,0,94,‾61
:Line(0,0,0,‾61
:Horizontal 0
:Horizontal ‾61
:41→A:Ans→E
:29→B:Ans→F
:1→H:0→V
:5→S:0→θ
:Pt-On(41,‾29,2
:Repeat not(pxl-Test(N-1,M-1
:2+3int(31rand→M
:2+3int(20rand→N
:End
:Pt-On(M,‾N,2
:Pt-Off(M,‾N,3
:Pxl-On(N,M
:Repeat 0
:getKey→K
:If Ans:Then
:If H:Then
:(Ans=34)-(Ans=25→V
:If Ans
:0→H
:Else
:(Ans=26)-(Ans=24→H
:If Ans
:0→V
:End
:End
:If H:Then
:A+3H→A
:If pxl-Test(B,Ans-H)
:Then
:Text(27,34,"SCORE:",θ
:Return
:End
:Pt-On(Ans,‾B,2
:Pxl-Off(B,Ans-H
:Pxl-Off(B,Ans-2H
:Else
:B+3V→B
:If pxl-Test(Ans-V,A:Then
:Text(27,34,"SCORE:",θ
:Return
:End
:Pt-On(A,‾Ans,2
:Pxl-Off(Ans-V,A
:Pxl-Off(Ans-2V,A
:End
:If pxl-Test(B,A
:Then
:Pxl-Off(B,A
:Repeat not(pxl-Test(N-1,M-1
:2+3int(31rand→M
:2+3int(20rand→N
:End
:Pt-On(M,‾N,2
:Pt-Off(M,‾N,3
:Pxl-On(N,M
:If θ=95:Then
:Text(27,34,"WIN.
:Return
:End
:Pxl-On(62,θ
:1+θ→θ
:S+3→S
:End
:If S:Then
:S-1→S:Else
:pxl-Test(F,E-1)-pxl-Test(F,E+1
:If Ans:Then
:Pxl-On(F,E+2Ans
:Pt-Off(E,‾F,2
:E+3Ans→E
:Else
:1-2pxl-Test(F+1,E
:Pxl-On(F+2Ans,E
:Pt-Off(E,‾F,2
:F+3Ans→F
:End
:End
:End
Thanks for any help and I hope someone notices this!