Writing BASIC 10-Liners on the Atari
Every spring, programmers around the world try to fit a whole game into ten lines of BASIC for the BASIC 10-Liner Contest, organised by Gunnar Kanold's homeputerium and in its fifteenth edition in 2026. Atari entries regularly win categories. This guide explains the rules, then the craft: how Atari BASIC's abbreviations and parser let you squeeze more into a line, how to pack logic with arithmetic instead of IFs, which dialect to choose, and a complete small game to take apart.
What you'll learn: the contest categories, Atari BASIC's keyword abbreviations (tested), packing tricks, the 120-character editor limit and its traps, when to use Turbo-BASIC XL or FastBasic, and a seven-line PUR-80 game.
What you need: Atari BASIC on any Atari 8-bit or an emulator. For the larger categories, Turbo-BASIC XL or FastBasic.
1. The rules
The 2026 rules, the contest's fifteenth edition, define these categories. All allow abbreviations, and line length is counted per logical line:
| Category | What | Max characters per line |
|---|---|---|
| PUR-80 | A game. Only the computer's factory built-in BASIC (on the Atari, Atari BASIC). | 80 |
| PUR-120 | A game, any line-oriented BASIC dialect | 120 |
| EXTREM-256 | A game, any dialect | 256 |
| SCHAU | A demo, tool or application rather than a game | 256 |
| PLUS (new in 2026) | A game that may also load background graphics, title pictures and music from disk or tape | 256 |
| WILD | Entries that break the rules; one per person | – |
The additional rules matter as much as the line limits. Outside PLUS, no data or program parts may be loaded from storage. The ten lines may not contain machine code, and all code must be visible in the listing, so no self-modifying code or hidden initialisation. POKEs are allowed, and so is compiling (the source must still be submitted). The program must be listable and come on a disk or tape image. Include a description, instructions on how to run it in an emulator, a screenshot and a listing that proves the line lengths. Keyboard games should use O, P, E and D for left, right, up and down where possible, so the keys work on QWERTY, QWERTZ and AZERTY keyboards alike.
Entries are judged by a jury, with a separate Public's Choice award based on the itch.io pages where every entry is published. For Atari BASIC programmers the important point is that PUR-80 is Atari BASIC only. Turbo-BASIC XL and FastBasic entries go into PUR-120 and up.
2. Abbreviations
Atari BASIC lets you shorten any statement keyword to its first letters plus a full stop. The rule is that the abbreviation matches the first keyword in BASIC's internal statement table that starts with those letters, so the table order decides. The table begins REM, DATA, INPUT, COLOR, LIST, ENTER, LET, IF, FOR, NEXT, GOTO… which is why D. means DATA, not DIM. These were checked by entering them and LISTing the result:
| Type | Get | Type | Get | Type | Get |
|---|---|---|---|---|---|
. or R. |
REM | G. |
GOTO | GR. |
GRAPHICS |
D. |
DATA | GOS. |
GOSUB | PL. |
PLOT |
I. |
INPUT | T. |
TRAP | DR. |
DRAWTO |
C. |
COLOR | RET. |
RETURN | POS. |
POSITION |
L. |
LIST | REA. |
READ | SE. |
SETCOLOR |
E. |
ENTER | RES. |
RESTORE | LOC. |
LOCATE |
F. |
FOR | POK. |
POKE | SO. |
SOUND |
N. |
NEXT | PR. or ? |
DI. |
DIM | |
CL. |
CLOSE | O. |
OPEN | P. |
POINT (not PRINT or POKE) |
Note the traps: P. is POINT, R. is REM (the rest of the line disappears), CO. is still COLOR, and NE. is NEXT, not NEW. ? is the shortest form of PRINT.
Spaces are optional. Atari BASIC's parser doesn't need them: F.W=1TO20, GOTO9 and IFX=1THEN9 were all accepted. Every space you leave out is a character saved.
3. The 120-character editor limit
The Atari screen editor never passes BASIC a line longer than 120 characters: three screen rows. That makes PUR-120 exactly "as long as Atari BASIC lets you type". It also hides a trap. When you LIST a densely abbreviated line, BASIC expands every keyword, so the listing can be much longer than what you typed. If you LIST such a program to disk and ENTER it again, the expanded line can exceed BASIC's 128-byte line buffer at locations 1408–1535. The overflow spills into page 6 (1536–1791), corrupting anything you had stored there, without necessarily raising an error. Keep your master copy as a SAVEd (tokenized) file, or as the abbreviated text you typed.
For EXTREM-256 and PLUS you need a way to make lines longer than 120 characters. FastBasic's own editor handles lines up to 255 characters, and its cross-compiler works from plain text files on a PC.
4. Packing tricks
Use small line numbers. Line 0 is legal, so a ten-liner can use lines 0–9, one digit each.
Arithmetic instead of IF. A comparison in Atari BASIC is worth 1 when true and 0 when false, so you can add it into an expression. This one line moves a player left and right with the joystick (7 is right, 11 is left) and keeps it between columns 1 and 35:
X=X+(J=7)*(X<35)-(J=11)*(X>1)
Without that trick it would take four IF statements, and each IF ends the useful part of a line. Everything after THEN on an Atari BASIC line runs only when the condition is true, so put IFs last on a line and order statements so the conditional part comes at the end.
Fall-through loops. IF Y<22 THEN 2 at the end of a line jumps back without needing a GOTO keyword; a line number after THEN is an implied GOTO.
Computed jumps and constants. GOTO and GOSUB accept expressions, so G.5+K can replace a chain of IFs. Short variable names (one letter) save characters everywhere.
Let the hardware keep state. The screen is memory: LOCATE or PEEK can tell you what is at a position instead of a separate array. Timers, colour registers and sound registers carry on by themselves once set.
Strings as tables. One string literal such as "0123456789" read with substrings (A$(N,N)) can replace DATA lines. In Atari BASIC it needs a DIM, so weigh the cost.
5. Which BASIC?
- Atari BASIC is the only choice for PUR-80, and it is built into every XL/XE. It is slow and has no ELSE, but it is the purest challenge. Recent PUR-80 entries include vitoco's Coordinator (2023) and Endless Road Runner (2024), and Eric Carr's Magic Carpet Ride (2024).
- Turbo-BASIC XL has historically been the most common Atari dialect in the contest. It runs Atari BASIC code faster and adds structured loops, IF…ELSE…ENDIF, procedures and many shortcuts. That lets one line hold a whole loop that Atari BASIC would need several lines and GOTOs for.
- FastBasic compiles integer BASIC and is much faster again. It has become the language of many winners: vitoco's Beetles won PUR-120 in 2023, and Eric Carr credited FastBasic for keeping the Atari at the top when he won two categories in 2024.
- ugBASIC produces multi-platform entries, though its runtime is large.
Write the version for your category from the start. A game designed in Turbo-BASIC rarely shrinks back into PUR-80.
6. A worked example: Star Catcher (PUR-80)
Move the catcher <=> left and right with a joystick in port 1 and catch the falling stars. You have five lives. The longest line is 71 characters as typed, line number included, so the game fits PUR-80 with room to spare. It runs on any Atari with Atari BASIC.
0 GR.0:POKE 752,1:X=18:S=0:M=5:SE.2,0,0
1 C=INT(RND(0)*36)+2:Y=2:POS.2,0:?"SCORE ";S;" LIVES ";M;" "
2 J=STICK(0):X=X+(J=7)*(X<35)-(J=11)*(X>1):POS.X-1,22:?" <=> ";
3 POS.C,Y-1:?" ";:POS.C,Y:?"*";:Y=Y+1:IF Y<22 THEN 2
4 POS.C,21:?" ";:IF C>=X AND C<=X+2 THEN S=S+1:SO.0,60,10,8:G.6
5 M=M-1:SO.0,200,12,8:IF M=0 THEN POS.15,10:?"GAME OVER":SO.0,0,0,0:END
6 F.W=1TO20:N.W:SO.0,0,0,0:G.1
How it works:
- Line 0 sets up a text screen, hides the cursor (
POKE 752,1), and makes the background black withSE.2,0,0. - Line 1 starts a new star at a random column and redraws the score.
- Line 2 is the player. It reads the stick, moves X with the boolean arithmetic above, and prints
" <=> "with a space on each side. Those spaces erase the old catcher wherever it moved from, so no separate erase step is needed. - Line 3 is the star. It erases the star's old position, draws it one row lower and loops back to line 2 until the star reaches the bottom. Each pass moves the player once and the star once, so the speed is set by BASIC itself.
- Lines 4–5 score a catch with a high beep, or cost a life with a low buzz. The IF is the last statement on each line. In line 4,
G.6is part of the THEN, so a miss falls through to line 5. - Line 6 is a short pause, then back to line 1 for the next star.
The listing uses only seven of the ten lines. Ideas for the other three: make the star fall faster as the score rises, add a second star, or use distortion 8 for a crash sound on a miss.
Troubleshooting
- ERROR 14 (line too long) when entering a line. The tokenized line is too big or too complex, even though it was under 120 characters. Split it.
- A line silently does nothing after an IF. Remember that everything after a false IF's THEN is skipped. Move the unconditional statements in front of the IF.
- A typed abbreviation became something else. Check the table:
P.(POINT) andR.(REM) are the usual surprises. LIST the line to see what BASIC understood. - The listing on disk won't ENTER back correctly. An expanded line overflowed the 128-byte buffer. Keep a SAVEd copy as your master.
- It works in your emulator but not for the judges. Test with the stock OS and BASIC, PAL and NTSC, and Altirra's default settings. The 2025 contest saw a game that depended on timing in one emulator setup.
Further reading
- The contest rules, games lists and results on the homeputerium site, and every entry with its listing on bunsen.itch.io.
- The Atari BASIC Source Book by Bill Wilkinson, Kathleen O'Brien and Paul Laughton (COMPUTE! Books, 1983): the statement name table behind the abbreviations, and the Program Editor's line limits.
- On this site: BASIC 10-Liner Contest 2023, 2024, 2025 and 2026; Turbo-BASIC XL: A Practical Guide; Getting Started with FastBasic; Making Atari BASIC Faster.
Credits
- Picture: Star Catcher, the seven-line PUR-80 example from this guide, running in an emulator. — Program authors; screenshot by the site
- homeputerium — BASIC 10Liner Contest 2026 rules (German and English) — gkanold.wixsite.com, 2026
- AtariAge — 2023 BASIC 10Liner contest is on! (dialect rules, PUR-80 built-in BASIC, category stats, vitoco entries) — AtariAge forum members, 2023
- AtariAge — 2024 BASIC Tenliners Contest is calling us!!! (ugBASIC runtime size, entries) — AtariAge forum members, 2024
- AtariAge — 2026 tenline basic competition (PLUS category rule quote) — AtariAge forum members, 2026
- AtariAge — Disabling the built-in E: editor (FastBasic editor supports 255-character lines) — AtariAge forum members
- Site news items basic-10liner-contest-2023/2024/2025/2026 (entries and results) — 2023
