In Jan. 1981, SYNTAX published LIGHTS OF THE CITY for the recently announced (and long-awaited) 8K ROM for the ZX80–it would be 10 months before ZX81’s were announced in the US. For kicks, we updated CITY for the TS2068–just as it was updated from a 1978 version for the PET.
Using simple graphics, this program generates an ever-changing video pattern like a growing city. To use, type RUN, then enter a PAUSE time (number of TV frames to display between moves). Depress P to run at top speed.
Variables x & y define line & column of the PRINT position. The program selects a random direction (up, down, right, or left), changes the current position accordingly, & prints a character there. Display freezes for z frames, then changes.
All the original program lines remain exactly, but we modified the program to add color. Lines 17 and 107 are totally new; line 5 shows a new INPUT prompt; line 100 includes an INK command inserted before c$.
You can run the old program on any ZX/TS with 8K of ROM: to see the original effect put your ZX/TS in FAST. Run this on your TS2068.
2 RANDOMIZE
5 INPUT "Number of Frames to pause?";z: REM "N..."; added
10 LET x=12
15 LET y=16
17 PAPER RND*7: CLS : REM add color
20 GO TO 31+40*RND
40 LET x=x+(x<>21)
41 LET c$="▄"
42 GO TO 100
50 LET y=y+(y<>31)
51 LET c$="▐"
52 GO TO 100
60 LET x=x-(x<>0)
61 LET c$="▀"
62 GO TO 100
70 LET y=y-(y<>0)
71 LET c$="▌"
100 PRINT AT x,y; INK RND*7;c$: REM ink added for color
103 IF INKEY$="p" THEN GO TO 20
105 PAUSE z
107 IF x=0 OR x=21 OR y=0 OR y=
31 THEN PAPER RND*7: CLS : LET x =12: LET y=16: REM Restart if touch edge of screen
110 GO TO 20
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.