Very nice screenshot, calc84maniac.

That's what I do, at any rate; a ring buffer with a pointer to the "head" element some way ahead of the "tail" element. Normally the head and tail pointers move forwards together, but to elongate the snake you can move the head pointer forwards and leave the tail pointer where it was.
As the game world is 24x16 units where each block is either "on" or "off" I use a 48 byte buffer (one bit per block) instead of a 1536 byte 24x16 array. This additional bit manipulation -
Code:
490 REM Get or set point in the world
500 DEFPROC_world(X%,Y%,V%)P%=Y%*3+X%DIV8:X%=X%AND7:IF V% world%?P%=world%?P%OR2^X% ELSE world%?P%=world%?P%ANDNOT(2^X%)
510 ENDPROC
520 DEFFN_world(X%,Y%)P%=Y%*3+X%DIV8:X%=X%AND7:=world%?P%AND2^X%
- probably does little for speed but it reduces memory concerns somewhat.
In a similar vein the longest snake would be 24x16 units long, and with an X and Y component for each you'd end up with a 3072 byte array, so I instead use a 768 byte buffer.
My screenshot was recorded at 15MHz, but I tried to get speed 9 roughly the same on both. (Last time I checked it played about as fast at 6MHz). You can make it run faster on an SE by removing the delay between frames entirely (currently capped at 3 centiseconds, ie 30ms) which is stored in the static variable
S%:
Code:
260 S%=(9-speed%)*5+3: ...
The game runs in the Windows version of BBC BASIC (where I originally developed it) if you can't be bothered to send it to your calculator.
