Snake

Developer(s): I. Jordan
Date: 1985
Type: Diskette
Platform(s): QL
Tags: Arcade

Snake is the classic arcade game: steer a snake around a red-walled arena, eat the apples and numbered blocks for points, and avoid the walls and your own tail. A title screen offers three levels, Easy, Reasonable and Impossible, chosen with F1 to F3; the game keeps a high score and shows the score and screen number along the top.

The title screen reads “Snake By I Jordan”, and the REMs date it August 1985. The game itself is machine code; the end line of the playfield signs it “Snake by I.K.J”.

Program Analysis

snake_bas opens a full-screen window, prints the title, reserves 2,900 bytes with RESPR, loads snake_code into them with LBYTES, then reads the level from a function key (the codes 232, 236 and 240 for F1 to F3) and pokes the speed into the code at a+329 before calling it.

Potential Issues

  • The loader expects the code on mdv2_; the floppy-image copy reads flp1_.

It came from a QL owner’s floppy copies of QUANTA and IQLUG library material, imaged double-stepped so that only half of each disk survived; this file read back complete. The download holds the files exactly as recovered and a QL5A floppy image, Snake.img, with the same files and their QDOS headers. Mount the image as FLP1_ (drop it on the QLRun page, or use it as a floppy image in sQLux, QPC2 or Q-emuLator) and type lrun flp1_snake_bas. In the image copies only, mdv2_snake_code reads flp1_snake_code so the program finds its files on the floppy.

Tested in QLRun with the JS ROM: the title screen, the level choice and a game in progress.

Image Gallery

Source Code

100 REMark Snake by I Jordan
110 REMark August 1985
120 MODE 4
130 OPEN #3,scr_512x256a0x0
140 PAPER #3,0:INK #3,4:CSIZE #3,2,1
150 CLS #3
160 AT #3,1,19:PRINT #3,"Snake"
170 AT #3,3,20:PRINT #3,"By"
180 AT #3,5,17:PRINT #3,"I Jordan"
190 a=RESPR(2900)
200 LBYTES mdv2_snake_code,a
210 CSIZE #3,0,0:INK #3,7
220 AT #3,14,30:PRINT #3,"Which level do you want?"
230 AT #3,16,32:PRINT #3,"(1) Easy"
240 AT #3,18,32:PRINT #3,"(2) Reasonable"
250 AT #3,20,32:PRINT #3,"(3) Impossible"
260 INK #3,4
270 AT #3,22,16:PRINT #3,"Press the function key corresponding to your choice"
280 REPeat get_level
290 level=CODE (INKEY$(-1))-232
300 IF level<12 AND level>-1 THEN EXIT get_level
310 END REPeat get_level
320 level=level DIV 3
330 POKE a+329,(48-level*4)
340 PAPER #3,2:CLS #3
350 CALL a
360 CLOSE #3
370 NEW

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.