--- title: "Macrolife" id: 77615 type: "computer_media" slug: "macrolife" url: "http://localhost/computer_media/macrolife/" markdown_url: "http://localhost/computer_media/macrolife.md" published_at: "2026-11-18T12:06:32+00:00" modified_at: "2026-11-22T09:55:57+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/macrolife-1.png" excerpt: "Life on the 256 x 192 pixel screen, with the generations worked out in machine code." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" genre: - name: "Simulation" slug: "simulation" taxonomy: "genre" url: "http://localhost/type/simulation/" media_type: "Program" download_url: "https://archive.org/download/timex-sinclair-software-archive/Macrolife%20%281986%29%28-%29%28TS2068%29%28Program%29.zip" tsrun_member: "Macrolife (1986)(-)(TS2068)(Program)/Macrolife (1986)(-)(TS2068)(Program).tap" mediadate: "1986" images: - url: "http://localhost/wp-content/uploads/2026/11/macrolife-1.png" - url: "http://localhost/wp-content/uploads/2026/11/macrolife-2.png" - url: "http://localhost/wp-content/uploads/2026/11/macrolife-3.png" article_media: - id: 42047 title: "Macrolife" type: "article" url: "http://localhost/article/macrolife/" media_type_tags: "Simulation" license: false --- # Macrolife A Life simulation on the full 256 x 192 pixel screen: every pixel is a cell. A cell with two or three neighbours lives, any other cell dies, and an empty square with exactly three neighbours gets a new cell. A 169-byte machine-code routine, POKEd at 32768 from the hex strings in lines 9100-9121, works out each generation, and the grid wraps top to bottom and side to side. Pick a starting pattern by its letter: Square, Cross, Circle, Rays, Grid, Frets or Random (printed “Randon”). The program was adapted from Toni Baker’s Macro-life article in ZX Computing, October 1986, which has the disassembly. The newsletter says it runs on a Spectrum or on a TS2068 with a Spectrum emulator; it also runs on a stock TS2068. Loading the code from the hex strings takes about 40 seconds after RUN. Option G prints its blocks at a random row from 0 to 29, but the screen has only 22 rows, so it can stop with an error. To turn the wrap-around off, the article adds a line 1005 that draws a border. Published in Sinc-Link November-December 1986 ([Macrolife](https://timexsinclair.com/article/macrolife/)). ## Source Code ``` 1 CLS : GO TO 100 5 PRINT AT 4,0;"Welcome to a simulation of life." 10 PRINT AT 7,2;"Included are a number of " 15 PRINT AT 8,2;"programed starts as well as";TAB 2;"a random start. You are";TAB 2;"encouraged to program your" 17 PRINT TAB 2;"own intial configurations." 20 PRINT #1;"ENTER to continue" 22 PAUSE 0 25 CLS 30 PRINT AT 2,6;"INITIAL CONFIGURATION" 32 PRINT AT 5,8;"A-----Square" 34 PRINT 'TAB 8;"B-----Cross" 36 PRINT 'TAB 8;"C-----Circle" 38 PRINT 'TAB 8;"D-----Rays" 40 PRINT 'TAB 8;"E-----Grid" 42 PRINT 'TAB 8;"F-----Frets" 44 PRINT 'TAB 8;"G-----Randon" 46 PRINT AT 21,1;"Press key for desired choice." 48 LET i=CODE INKEY$: IF i<97 OR i>103 THEN GO TO 46 50 IF INKEY$<>"" THEN GO TO 50 52 CLS : GO TO i*5 100 CLEAR 32767: LET a$="": RESTORE 9100 110 FOR i=0 TO 21: READ d$ 120 LET a$=a$+d$: NEXT i 130 LET address=32768: FOR i=1 TO LEN a$-1 STEP 2 140 POKE address+INT ((i-1)/2),(CODE a$(i)-(48 AND CODE a$(i)<58)-(55 AND CODE a$(i)>64))*16+CODE a$(i+1)-(48 AND CODE a$(i+1)<58)-(55 AND CODE a$(i+1)>64) 150 NEXT i 155 GO TO 5 485 PLOT 88,48: DRAW 80,0: DRAW 0,80: DRAW -80,0: DRAW 0,-80 487 GO TO 1000 490 FOR i=USR "a" TO USR "a"+7: POKE i,128: NEXT i 491 PRINT #0;AT 0,16;"\a";TAB 16;"\a" 492 PLOT 0,80: DRAW 255,0: PLOT 128,0: DRAW 0,175 493 GO TO 1000 495 FOR i=10 TO 80 STEP 10: CIRCLE 128,80,i: NEXT i 497 GO TO 1000 500 OVER 1: FOR i=-128 TO 127 STEP 3 501 PLOT 128,0: DRAW i,175: NEXT i: OVER 0 502 GO TO 1000 505 FOR i=USR "a" TO USR "a"+6: POKE i,1: NEXT i 506 POKE i,255: PRINT #0;AT 0,0; 507 FOR i=1 TO 704 508 PRINT "\a";: IF i<65 THEN PRINT #0;"\a"; 509 NEXT i: GO TO 1000 510 FOR i=60 TO 140 STEP 20: PLOT 0,i: DRAW 255,0: NEXT i 511 FOR i=16 TO 256 STEP 32: PLOT i,60: DRAW 0,79: NEXT i 512 GO TO 1000 515 FOR i=1 TO 4: LET x=INT (RND*30): LET y=INT (RND*20): PRINT AT x,y;"\'.\'.\'.\'.\'." 516 NEXT i 517 GO TO 1000 1000 RANDOMIZE USR 32845 1010 GO TO 1000 9100 DATA "257CF6F83C20417D" 9101 DATA "D6206F7C3805C608" 9102 DATA "671835FEBF203126" 9103 DATA "D7182D247CE60720" 9104 DATA "277DC6206F7C3805" 9105 DATA "D60867181BFED820" 9106 DATA "1726C01813CB0130" 9107 DATA "0F7D3D1806CB0930" 9108 DATA "077D3CADE61FAD6F" 9109 DATA "79A6C804C9210040" 9110 DATA "1100C0010018D5ED" 9111 DATA "B0E10E800600C5E5" 9112 DATA "CD0080CD3D80CD1B" 9113 DATA "80CD1B80CD3580CD" 9114 DATA "3580CD0080CD0080" 9115 DATA "78E1C1CBBCFE0238" 9116 DATA "0CFE043008FE0320" 9117 DATA "0879B61803792FA6" 9118 DATA "77CBFCCB0930C5CD" 9119 DATA "41807DE61F20BDCD" 9120 DATA "1B807CEEC0B520B4" 9121 DATA "C9" ```