★Elara S. Novikova
Iskra-226

SNAKE

Змейка

The snake, arcade lineage from the mid 1970s; my own code, 2026

The reason the whole real-time side of this project exists, and since 16 August a real snake: a growing body, a bordered field, food that lands where chance puts it. The first version was fifty-six lines and had none of that. A snake needs a key read that does not stop and wait for Enter, and the dialect had a token for exactly that which my interpreter did not implement. SNAKE is the program that forced it. Everything on these disks that moves by itself came afterward.

sectors
20-26
source lines
128
field
38 x 16
step limit
none
Two apples in, three body cells on the field, the third apple waiting. The field stays on screen now; the first version wiped it every step.
Two apples in, three body cells on the field, the third apple waiting. The field stays on screen now; the first version wiped it every step.

Run this disk · The image, 256,256 bytes

The token that was just sitting there

KEYIN, 0x25, was in the token table from the beginning, and the firmware names a handler address for it. Nothing in the recovered corpus ever calls it. Accounting software asks a question and waits for the answer; it has no use for a key that might not have been pressed. So the token stayed a name in a table for a long time. A snake cannot work that way. It has to keep moving whether or not you touched anything, which means the read has to be allowed to come back empty and let the program continue on the next line. Implementing that opened everything else.

Why the snake never turned

The first version steered nowhere. Press 4 and it went straight on into the wall, every time, exactly as if the key had not been pressed at all. KEYIN was writing both the character and its code, into both variable spaces, so a comparison like IF V10 = 52 was reading a slot that held a string as well as a number, and the string won. Every branch failed and the snake kept its heading until it hit something. The corpus decides the question: comparisons here are numeric, BAM3 line 1160 opens with ON V21+1, so the slot holds the code alone.

What is on the disk

Twenty by ten of playing area, held as bounds rather than drawn as a grid: the program prints one status line per step with the head, the apple and the score, and the wall exists only as four comparisons. There is no tail, so the only ways to lose are the wall and the forty step clock. The apple does not jump at random either. It walks a fixed pattern, five columns back and three rows on, wrapping when it leaves the field, because the dialect's random number atom is still undecoded and a constant is more honest than an invented encoding.

Not a find

Written in 2026. The snake is one of the oldest mechanics there is, common property since the arcade cabinets of the mid seventies, and this code is new and in Russian. No Soviet games disk was recovered by this project or by anyone else, and the qualifier belongs on the small disks as much as on the large ones: three sectors, one catalog entry, a header in sector 0, all of it in a format copied from the sides that really were read, wrapped around a program that is entirely mine.

What I checked

All checked: loaded, started, played to an outcome. SNAKE takes its keystrokes through it.key_source, a callable returning a key code or None, the same way TETRIS is driven.

What this does not show

What is tested is the emulator, not the hardware. The pace is still counted in program statements rather than seconds, so the game runs at whatever speed the host paces it to, exactly like TETRIS. Self collision is real but rare below a length of five, and the original fifty-six-line version, the one with no body at all, is what the v1.0 tag preserves. This page described that version until 16 August 2026; the shape of the story did not change, the snake did.

Where to read more

The source

SNAKE.bas, 128 lines, assembled onto the image with iskra_asm.py

128 lines of BASIC
10 REM SNAKE 2 - REAL BODY
20 PRINT HEX(03)
22 PRINT AT(1,30);"* З М Е Й К А *"
24 PRINT AT(2,24);"4-ВЛЕВО 6-ВПРАВО 8-ВВЕРХ 2-ВНИЗ"
26 PRINT AT(1,55);"СЧЕТ:"
28 PRINT AT(1,61);"0"
30 V70 = 3
32 FOR V71 = 10 TO 49
34 PRINT ATV(V70,V71);"="
36 NEXT V71
38 V70 = 20
40 FOR V71 = 10 TO 49
42 PRINT ATV(V70,V71);"="
44 NEXT V71
46 V71 = 10
48 FOR V70 = 4 TO 19
50 PRINT ATV(V70,V71);"!"
52 NEXT V70
54 V71 = 49
56 FOR V70 = 4 TO 19
58 PRINT ATV(V70,V71);"!"
60 NEXT V70
62 V01 = 20
64 V02 = 11
66 V03 = 1
68 V04 = 0
70 V11 = 1
72 V12 = 1
74 V13 = 1
76 V14 = 0
78 A10(1) = 20
80 A11(1) = 11
82 V20 = 7
84 V20 = V20 * 38
86 V20 = V20 + 20
88 V20 = V20 - 10
90 A20(V20) = 1
92 PRINT ATV(V02,V01);"#"
94 GOSUB 800
96 GOTO 200
200 KEYIN V10, 210, 248
205 GOTO 248
210 IF V10 = 52 GOTO 220
212 IF V10 = 54 GOTO 226
214 IF V10 = 56 GOTO 232
216 IF V10 = 50 GOTO 238
218 GOTO 248
220 IF V03 = 1 GOTO 248
222 V03 = 0 - 1
223 V04 = 0
224 GOTO 248
226 IF V03 < 0 GOTO 248
227 IF V03 = 0 GOTO 229
228 GOTO 248
229 V03 = 1
230 V04 = 0
231 GOTO 248
232 IF V04 = 1 GOTO 248
234 V04 = 0 - 1
235 V03 = 0
236 GOTO 248
238 IF V04 < 0 GOTO 248
240 IF V04 = 0 GOTO 242
241 GOTO 248
242 V04 = 1
243 V03 = 0
248 FOR V90 = 1 TO 22
250 NEXT V90
260 V05 = V01 + V03
262 V06 = V02 + V04
270 IF V05 < 11 GOTO 900
272 IF V05 > 48 GOTO 900
274 IF V06 < 4 GOTO 900
276 IF V06 > 19 GOTO 900
280 V21 = V06 - 4
282 V21 = V21 * 38
284 V21 = V21 + V05
286 V21 = V21 - 10
288 IF A20(V21) = 1 GOTO 920
290 IF V05 <> V30 GOTO 350
292 IF V06 = V31 GOTO 400
350 V40 = A10(V12)
352 V41 = A11(V12)
354 V22 = V41 - 4
356 V22 = V22 * 38
358 V22 = V22 + V40
360 V22 = V22 - 10
362 A20(V22) = 0
364 PRINT ATV(V41,V40);" "
366 V12 = V12 + 1
368 IF V12 < 601 GOTO 420
370 V12 = 1
372 GOTO 420
400 V14 = V14 + 1
402 V13 = V13 + 1
404 PRINT AT(1,61);V14
406 GOSUB 800
420 V11 = V11 + 1
422 IF V11 < 601 GOTO 426
424 V11 = 1
426 A10(V11) = V05
428 A11(V11) = V06
430 A20(V21) = 1
432 V01 = V05
434 V02 = V06
436 PRINT ATV(V02,V01);"#"
440 GOTO 200
800 V30 = RND(1)
802 V30 = V30 * 38
804 V30 = INT(V30)
806 V30 = V30 + 11
808 V31 = RND(1)
810 V31 = V31 * 16
812 V31 = INT(V31)
814 V31 = V31 + 4
816 V32 = V31 - 4
818 V32 = V32 * 38
820 V32 = V32 + V30
822 V32 = V32 - 10
824 IF A20(V32) = 1 GOTO 800
826 PRINT ATV(V31,V30);"$"
828 RETURN
900 PRINT AT(22,26);"*** ВРЕЗАЛИСЬ В СТЕНУ ***"
910 GOTO 930
920 PRINT AT(22,27);"*** СЪЕЛИ СЕБЯ ***"
930 PRINT AT(23,29);"СЧЕТ:"
932 PRINT AT(23,35);V14
934 END

I wrote about this at the time

Back to Iskra-226