Biscuit Snake

In-game screen.

Program listing on 48K Spectrum.

Text Listing

1 BORDER 2:
 POKE 23693,7:
 CLS :
 LET m=704:
 LET s=0:
 LET t=1:
 LET h=3:
 LET d=0:
 LET p=9:
 LET q=9:
 LET n=1:
 LET w=0:
 LET c=0:
 DIM x(m):
 DIM y(m):
 FOR i=t TO h:
 LET x(i)=15:
 LET y(i)=15-i:
 PRINT AT y(i),x(i); INK 6;"o\@"(1+(i=h)):
 NEXT i:
 RESTORE :
 READ v,w,i,k,d,d,x,y:
 IF (x>-1)*(x<32)*(y>-1)*(y<22) THEN READ u,e,p,q,s,f,n:
 PRINT AT y(t),x(t);" " AND f=0;AT 0,0;s; INK n;AT q,p;"O"; INK 6;AT y(h),x(h);"o";AT y,x;"\@":
 BEEP .01,24*e:
 READ h,x(h),y(h),c,t:
 POKE (u<>6)*23620,21:
 DATA .5+w*30-p,i,RND,CODE INKEY$,d+(k=54)-(k=55),d+8*((d<0)-(d>7)),x(h)+(d>4)-(d<4)*(d>0),y(h)+(d>2)*(d<6)-(d<2 OR d=7),ATTR (y,x),u<6,p+e*v,q+e*(.5+w*20-q),s+e*u,c>0,n+e*(.5+i*5-n),1+h*(h<m),x,y,c+e*u-f,1-f+t*(t<m+f)

Download the game

About the game

In this game, you control a snake that likes to eat biscuits. The keys are 6 - turn left, 7 - turn right. Guide the yellow snake onto the coloured biscuits as they appear on the screen. After eating a biscuit your score will increase by a number of points depending on the colour of the biscuit eaten and a new randomly coloured biscuit will appear in a random position on the playfield. The length of the snake also will increase by the same number of segments. The game ends if either the snake hits the edge of the screen, or if the head of the snake hits part of its own body. There are eight directions the snake can travel in, which includes diagonal as well as straight. This one-liner game was inspired by the freeware game "Pizza Worm" for MS-DOS. Thanks to Einar Saukas for freeing up enough space in the game to allow for multi-coloured biscuits, and still have 33 characters of space remaining (under the one-liner contest limits) in the final game listing. Also Einar suggested many other improvements. These included improving the timing of the game to make it more responsive and reducing the random element down to a single RND statement, speeding the game up amongst other things. The biscuits are worth the following number of points:- blue - 1, red - 2, magenta - 3, green - 4, cyan - 5.

Back to Sinclair stuff index