A downloadable game

Download NowName your own price

Snack-e: A 10-Liner Cookie Quest

Can you satisfy the hunger of a growing serpent with only 720 characters of code?

Created for the 2026 Mr. Kanold Basic 10-liner contest (PUR-80 Category), this game is a nice try in code density. Packed into 10 lines of 80 characters, Snack-e attempts to deliver a complete survival experience by exploring the constraints of Amstrad BASIC.

I chose not to use any code abbreviations, focusing instead on squeezing the logic to fit every feature into the strict PUR-80 format. It’s a sincere effort to see how much "game" could fit into such a small, un-shortened footprint.

How to Play:

  • Goal: Hunt for cookie snacks and grow your tail as much as possible.
  • Controls: Use the Arrow Keys (Cursor) to steer.
  • Challenge: Don't hit the walls or yourself! and....
  • "Find the bug that leads to freedom."

Loading the game:

Load the snack-e_10liner-pur80.dsk disk into the emulator
type:
run "snack-e"


Additional info

Source code description:

1 Welcome and game instructions
2-3 Screen and variable initialization
4-5 Player logic
6 Cookie logic
7 Collision detection, scoring, and player position screen refresh
8 You found the bug!!!! (so difficult) and WON the game!
9-10 Collision detection (death), life counter, and GAME OVER

Variables:

- t Time counter initialization ((time-t)/300 = player survival time = a) (in-game:LTA): Last time  alive
- x y Player coordinates
- i j Player horizontal or vertical speed
- d Player death counter
- p Player score counter
- c Counter for spawning a new cookie

Other details:

- In line 3, I defined a function FNp to allow random cookie placement 
- In line 6, freeing up enoug h space to add a sound effect.
- In lines 4 and 5, I defined variables g$ and f$ to ensure enough space in line 10 for the final  message.
- In line 4, the cookie counter is incremented; while this logic belongs in line 6, it was moved here to keep the code within the 80-column limit.

Throughout the program, I have avoided using the "?" abbreviation for the PRINT command. I wante d to stay true to the Amstrad CPC experience, ensuring the listing remains within 80 columns when di splayed.

Loading and verification instructions:

Load the snack-e_10liner-pur80.dsk disk into the emulator
load "snack-e"

To view the listing adjusted to 80 columns:
mode 2:list

To run the game:
run

### Spoiler: The "Freedom Bug" Explained ###

Due to extreme code compression and the specific logic in the function that calculates cookie coordinates, a cookie may occasionally spawn exactly on the right-side wall of the play area.

If the player manages to eat a cookie at that precise coordinate, the snake's trail will be able to breach the boundary and escape the grid. This is a deliberate nod to a famous scene from the movie TRON just like a light cycle finding a way out of the Game Grid. Can you find the "glitch" and reach freedom?


Información adicional

Descripción del código:

1 Bienvenida e instrucciones del juego 
2-3 inicialización de pantalla, variables
4-5 lógica del jugador
6 logica de galletas
7 calculo de colisiones con puntos y refresco de posiciones de jugador en pantalla
8 You found the bug!!!! (so difficult) and WON the game!
9-10 cálculo de colisiones con muerte número de vidas y GAME OVER

Variables:

- t inicialización del contador de tiempo ((time-t)/300 = el tiempo que lleva el jugador vivo = a) (en el juego: LTA): tiempo vivo la vez anterior
- x y coordenadas del jugador
- i j velocidad horizontal o vertical del jugador
- d contador de número de muertes del jugador
- p contador de puntos del jugador
- c contador para imprimir una nueva galleta

Otros detalles:

En la linea 3 he definido una función FNp para que así en la linea 6 pueda colocar galletas aleatoriamente en la pantalla dándome espacio suficiente para añadir un sonido.

En las lineas 4 y 5 he definido las variables g$ y f$ para que así tenga espacio suficiente en la línea 10 para mostrar el mensaje

En la línea 4 se aumenta el contador de galletas, le correspondería estar esta suma en la línea 6, pero entonces no cabría el contenido del código en 80 columnas.

En todo el programa hemos prescindido del uso de la abreviatura "?" que sustituye al comando PRINT. He querido ser fiel a que en un Amstrad CPC se pueda mostrar el listado y que respete igualmente el máximo de 80 columnas.


Instrucciones de carga y comprobación:

Cargar el disco snack-e_10liner-pur80.dsk en el emulador
load "snack-e"

Para ver el listado ajustado a 80 columnas:
mode 2:list

Para ejecutar el juego:
run

See other games from this contest here

Updated 1 day ago
Published 4 days ago
StatusReleased
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
Authorjoselet
GenreSurvival

Download

Download NowName your own price

Click download now to get access to the following files:

snack-e.dsk (Amstrad CPC) 199 kB
snack-e_10liner-pur80.src.dsk 199 kB
if you pay $1 USD or more

Leave a comment

Log in with itch.io to leave a comment.