--- title: "Extended Basic Demo" id: 56677 type: "computer_media" slug: "extended-basic-2" url: "http://localhost/computer_media/extended-basic-2/" markdown_url: "http://localhost/computer_media/extended-basic-2.md" published_at: "2024-09-22T23:31:36+00:00" modified_at: "2026-04-03T07:59:04+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2024/09/5_EXTBAS.bmp" excerpt: "A self-running demo showcases an Extended BASIC cartridge's extra commands—DRAW, FILL, SCROLL, CIRCLE, and more—all driven by a clever machine-code interpreter hidden inside a single REM line." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "Thomas B. Woods (company)" slug: "thomas-b-woods" taxonomy: "post_tag" url: "http://localhost/tag/thomas-b-woods/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Frits Beniest" slug: "frits-beniest" taxonomy: "indiv" url: "http://localhost/indiv/frits-beniest/" - name: "Thomas B. Woods" slug: "thomas-b-woods" taxonomy: "indiv" url: "http://localhost/indiv/thomas-b-woods/" genre: - name: "Programming" slug: "programming" taxonomy: "genre" url: "http://localhost/type/programming/" media_contents: - id: 57780 title: "CassFile2" type: "computer_media" url: "http://localhost/computer_media/cassfile2-2/" media_type: "Cassette" programmers: - name: "Thomas B. Woods" slug: "thomas-b-woods" taxonomy: "indiv" url: "http://localhost/indiv/thomas-b-woods/" - name: "Frits Beniest" slug: "frits-beniest" taxonomy: "indiv" url: "http://localhost/indiv/frits-beniest/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Extended%20Basic%20%281983%29%28Thomas%20Woods%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1983" images: - url: "http://localhost/wp-content/uploads/2024/09/5_EXTBAS.bmp" related_products: - id: 12513 title: "Extended Basic" type: "product" url: "http://localhost/product/extended-basic/" media_type_tags: "Programming" --- # Extended Basic Demo This is a demonstration program for “Extended BASIC,” a machine-code extension for the ZX81/TS1000 authored by Frits Beniest, showcasing the additional commands it provides. The program’s BASIC lines act primarily as a driver: nearly all graphical and I/O work is delegated to machine code via the recurring GOSUB 0 idiom, where line 0 begins with a USR call that transfers control to the extension’s Z80 routines embedded in a large REM block. The extended commands exposed through REM statements include DRAW, FILL, FIL, UNDRAW, SCROLL, MOVE, CIRCLE, PAPER, UNPAPER, RESTORE, READ, PRINT AT, CLS, and OUT, all parsed and executed by the machine code. The demo cycles through animated sequences—logo drawing, fill-pattern flicker, scrolling text spelling out character-per-second statistics, a shooting sequence, and synthesiser output via OUT to the AY or similar sound hardware—before looping back to line 10. Data for animation sequences and music note values is stored in REM DATA blocks at lines 4000, 4010, and 5000, read back at runtime by the extended BASIC READ command. *** ## Program Analysis ### Overall Architecture The program is a demonstration of an Extended BASIC package written by Frits Beniest. Its structure is unusual: almost no visible work happens in conventional BASIC statements. Instead, nearly every action is performed by calling `GOSUB 0`, which reaches line 0. Line 0 contains `IF USR . THEN RETURN`; the `USR .` expression calls the machine-code interpreter embedded in the program (the dot resolves to a stored numeric value representing the entry point). The interpreter then reads the command text stored in the `REM` statement on the line *immediately following* the `GOSUB 0` call, executes it, and returns. This means every `REM` after a `GOSUB 0` is not a comment but an extended-BASIC command string. ### Machine Code (Line REM Block) The large `REM` on the unnumbered line (line 0 area, before line 1) contains several hundred bytes of Z80 machine code — the entire Extended BASIC interpreter/runtime. Key entry points visible in the hex stream include calls to ROM routines (e.g., `\CD\A7\0E` = CALL 0E A7h, the ZX81 error handler area) and structured dispatcher logic. The code handles command parsing, coordinate arithmetic for graphics primitives, OUT port writes for sound/hardware control, and data READ/RESTORE operations against `REM DATA` lines. ### Extended BASIC Commands Used The following commands appear inside `REM` strings and are executed by the machine-code interpreter: - `DRAW` / `UNDRAW` — draw and erase line sequences by coordinate lists - `FILL` / `FIL` — fill rectangular screen regions with a specified character - `SCROLL` — scroll the screen by a given number of lines - `CLS` — clear screen via the extended system - `RESTORE` / `READ` — read from `REM DATA` blocks at specified line numbers - `PRINT AT` — positioned print within the extended command stream - `OUT` — direct hardware port output (used for border colour and sound chip control) - `MOVE` — animated character movement - `CIRLE` (sic) — circle drawing (apparent typo in source for CIRCLE) - `PAPER` / `UNPAPER` — area attribute-style fill/clear ### GOSUB 0 Dispatch Idiom The entire demo is structured as a sequence of paired lines: a `GOSUB 0` line followed by a `REM` line containing the extended command. The machine code in the interpreter presumably uses the return address on the stack to locate the `REM` text on the following line, execute it, then perform a true return to the BASIC line after the `GOSUB`. This is a well-known technique for embedding interpreted sub-languages in ZX81 BASIC without altering the BASIC line structure. ### DATA Storage in REM Lines Lines `4000`, `4010`, and `5000` hold `REM DATA` blocks. The extended `READ` and `RESTORE` commands target these by line number (e.g., `RESTORE;4000`, `RESTORE;5000`). Line 4000 stores string data for the animation (labels such as “UNDRAW”, “ZX-81”, “COPYRIGHT 1983”, author name variants). Line 4010 stores the “SHOOTING IN EXTENDED-BASIC” title screen strings plus a count value (63). Line 5000 stores numeric pairs used as note/duration data for the sound output routine at lines 7005–7050. ### Sound / Hardware Output Lines 7005–7050 implement a short musical phrase subroutine. It restores and reads pairs of values `L, J` from `REM DATA` at line 5000, then outputs them to hardware ports via `OUT;219,0,223,J,219,1,223,L`. Port 219 (0xDB) with sub-addressing via port 223 (0xDF) is consistent with an AY-style sound chip or the ZX81’s own port-mapped hardware. Lines 7100–7190 provide a short descending tone sweep (H from 250 to 0 step −80) also sent via `OUT;223,H`. ### Demo Sequence Structure 1. Lines 10–30: Draw the Extended BASIC logo, animate a colour-ramp on the border (K=6*N, output to port) 2. Lines 40–68: CLS, diagonal fill wipe, animated DEMO/FILL flicker loop (6 outer × 6/6 inner iterations) 3. Lines 80–109: Info screen showing “THIS PROGRAM RUNS IN EXTENDED BASIC” with animated fill borders, repeated 10 times 4. Lines 110–120: Summary screen listing SCROLL, FILL, RESTORE, CLS commands 5. Lines 300–320: Three calls to the sound subroutine at 7100 6. Lines 500–553: Full-screen drawing of “FB” monogram / geometric pattern with expanding square spiral animation 7. Lines 574–645: 3×3×4 nested loop drawing and erasing cross/grid patterns with fill transitions 8. Lines 700–714: Scrolling character-set display with two-pass SCROLL and DRAW of letter outlines 9. Lines 750–815: Colour-cycling fill across all 37 fill characters (0–9, A–Z, (A)) with short delay loop 10. Lines 816–890: Music playback, shooting animation with DRAW/UNDRAW, CIRCLE spiral, PAPER/UNPAPER flash, then `GOTO 10` to loop ### Variable Usage | Variable | Role | | --- | --- | | `A$–G$` | String data read from REM DATA at line 4000/4010 (labels, decorative strings) | | `A` | Initialised to 0; used as fill-character argument `(A)` meaning space/clear in extended commands | | `N` | General loop counter (FOR loops at lines 20, 705, 755, 825, 862, 870) | | `K` | Border colour ramp value (line 26: `K=6*N`); also inner loop counter | | `S` | Outer loop counter / step counter in several sections | | `W` | Delay loop variable and outer animation counter | | `H` | Sound sweep value (250 to 0 step −80) | | `J, L` | Note frequency/duration values read from DATA at line 5000 | | `M` | Middle loop counter in lines 579–640 | ### Notable Anomalies - Line 873 contains `REM CIRLE;N,N,N,` — “CIRLE” appears to be a typo for “CIRCLE”; whether the interpreter accepts this abbreviation or it is a genuine spelling error in the source is unclear. - Lines 600–601 and 630–631 are empty `FOR/NEXT` loops (`FOR W=1 TO 5 : NEXT W`) used purely as delay loops, a standard ZX81 timing technique. - The fill character argument `(A)` in extended commands refers to the BASIC variable `A` (value 0 = space character), used to clear filled regions. - Line 890 is `GOTO 10` making the demo an infinite loop; lines 900–910 (`SAVE` and `RUN`) are only reachable manually. ## Source Code ``` 0 IF USR . THEN RETURN FROM EX. BASIC AUT: FRITS BENIEST (C) 070/988735 %V%E%R%S%I%E% %2%.%17676%-%-!!RND%E6C""73''''''5E' POKE 6D' U£RND47U(RNDLEN SCROLL %SCOS INT $.'.'INKEY$( SAVE INT 7C 76C''7( POKE INT 7D6USR RNDTAN Y. %SATN 62INKEY$%(4FFLN 5AINKEY$$COS 2~~57LN NINKEY$$COS 26457LN NINKEY$TAN FLN 5AINKEY$ RETURN COS 477A..>=62INKEY$( IF TAN 6USR RNDLN '44COS RETURN :TAN TAN PLOT SQR Y3 PLOT SQR INT 3 AT STR$ LN ATN INKEY$LN INKEY$LN EXP INKEY$.'=VAL FAST STR$ .''',%Y4~~LN LN INKEY$<( PLOT AT AT AT TAN SGN LPRINT <<<<K''7A%(**INT 75 CLEAR ACS 5'.C3C4B CLEAR ACS 5LEN / RUN U5RNDACS ./: U5RNDACS SIN M5RNDC3 REM 42FE0C8F5CD2015F1CD1D15EF534CDA7EC9EBCDEF40CD9042CDA542CDB242CDCE42CD4C4920EFC911D84064D5CD842CDCD41CD141CD64912D1C9EB61ACD364223622CD3642C921DB407E2B96604E5F2B7E2B96577E2AC409E213DC8918FBC9E53ADC4043CDF4E10FBE19E51520F4E1C97EB9D8CF75C5C3C645C9EBCDEF4011D84064D5CD842D1EB2346234E702B712B0E40CDE04223CDE042E3023CDE04223CDE04221D840113D4062CD74451362CD74451E0213E40CD48452323CD4845233A3F4077CD4845213C4073160CB46201E3A40405FCD5B45ED5345401603A42405FCD5B45ED534740D53A4340181B3A3D405FCD5B45ED5345401603A43405FCD5B45ED534740D53A4240C1CD6842ED434940213C40CB4620ECB4E282CBDECB562810CBE618CCB4E282CBE6CB56282CBDE114B40237E12232323137E12213C40CB462053A43401833A424047402A4540113F019224540CDE542CD4C49C25449C9236311E9434E1AB9C0231310F8C929263923235E23562319C932323232232323237EFEEAC93232CDCD417EFE76C9323232E52323EBA72A1440ED52E1C93232322AD640CDF29EB22D640C932323232C6402AD640CD4149C8F52A104022D640CDC44DC5D44F1CD4149C8F5CD1B4418EFC932E52323EB2AC40A7ED52E1C93232CF72CF1EBCDEF40221640CD7547189CDEC43CD4D44DC5B44E5CDF843205CDDA43283E118E9D1CDEF40000022DE40C92432323232CD1D152A1C40150ED42221C40ED5BD64013EDB0C93232322ADE40CD24420723CD7444CDCD41221640CDBA46DF22DE40FE1AC8CF7DEBCDEF40CDCD41CD141CD2242CD68472AD440CD4B4120EFC92A104022D6402A240C9C5CB384CB39C3E1990472AC40112101811910FD5919C1CD99463E2F90473E1CB283023E4CB293017F57E7FE10306F302EE8F47CD9146285F12FA0182F1B0FE8382EE8F77C99677C9CB7E203CBCEC9CB8EC97E2B96385CB1323185CB137E23962377C99667A7CB13CB1210F9C9239667A7CB1ACB1B10F9C94B40ED7E12231310FAC92A4540ED5B49403A3C40CB5F2031918797ED52302676C224540EBCD6745C9C53A3C40CB47205214B40183214C40CB672033418135CD7B45213C407BCB46205324C40183324B40ED4B4B40CDED44C110CBC9E5EB5E2356EBD11DD45C5E92AD440CDCD41FEE206CDCD41C3FE412AD240221640110C9CDF46385CD164118ACD2242CD2A44CD174679C91B1B1B5F2B3E2596237BC9CD1E46CDA7EC92A1C401509221C40ED42EB2AD64023EDB0C91B0CD4F4E2AC402322E403E032DC401E201618E21CDCE42C92336123362123360CDAE42C9ED5BC402121013191F72EDB0620EB3602310FBCD3648C9C9000EBCDEF4011D84061D5CD842D11A3C47C5CD5A46C110F9C93A2140CB47C93D3DCD91462097EE678FE0C8360C97EE678FE0C8C1C9CDAD48384CDD89C9E1C9FE16289FE15201E7CDD914C9E7CDD914E5CD851BCDA01AE1C92ADE40237EFE7620523CD7444232B22DE40C91B2ADE4023CDF54622DE40C91B1B1007EFE1AC8FE76202CF7D32318F21B1B2AD640234E36023463602378B1C460AC92AD6402371237023CD9E9C91B1B2B7EA728FBCDCE14382CF70C620CD2C44237E23B6283CD847CDD44623E5CDE846C5CD1A47C1E178B1C8ED5BD640131313EDB0C91BCD2A44CDAC44CD9644C9FED205CD2847183CD5E47C9E7CDBA46DF22D4407EFE1A282CF7DCD8A1520578FE40382CF146069CDD89C97EFE76201231ACB772823E8F771323B78B1C8D5ED5B3C40ED5219D138E1D5C522E40CD5A462AE40C1D118D20EBCDEF40CD5548CDCD41CD141CD2242FEDF5CC1C42CD28494FF1F579282C620C620CD2C44F1F5C42E49F1CC3B49EB2A10402B223C402AE40CDA74722E40CD12482AD440CD4B412B20BBC9A72AE40ED5BC4013ED52112103E18ED523833D18F9323A40197B95323940C91B1B1B3A3A40FE182062AC4023189A72AE4011210ED5222E40CD1248C9CF17E5CD1C42FE3920F6CD1C42FE26282E1C9E111D840D562CD842E1E18CDE04223E20CDE0422AC40233AD840FE028747112101910FD3AD9401605F1922E40CD12482AD440C91B1B1BEB2BCDEF4011D84061D5CD842CDCD41CD141CD2242CD2A44D11A4FED78CD93442AD440CD4B412B20DAC9BCEBCDEF4011D84062D5CD842E14E2346FDCB3B76288ED410D3FE7618CCB41F5CC2BFF1ED41CC23F2AD440CD4B412B20D0C9CF73CB4028FACD2242CB48C0FE1120F02B2B3E10BE20E92323D5CD146D1CB77C83E8FC9CDCE14D8CF70CD1E46CDD51BE5CDA314E1C91B234E234623C9BEC8FE60D8CBFFBECBBFC92AD440CD4B412BC9E521D940545D7E1B122323137E12E11BD5131362C3F442251CEBCDEF40CD904211D840D5213C40EB140EDB0D1CDA542CDB242227B40D52AD44011DD4061CD8424F1B1B1AD9D1D90FE2A28EFE3C28AFE332826FE382822CF16C5D9C1D9FE2A282CBC8FD7021213E40621E21CDC54A2A7B40CD5E4AC3124AF5C5E1C5D165CD5D4519E5D9C1D960F1FE38202CBC0FD7021213C40621E19CDC54A2A7B40FDCB214628FD9D5D9C1112101811910FD227B40CD374ACD4C49C811DC40CDCD41CD141CD64912C37549ED5B1040ED52193FD8ED5BC40ED5219C9D9C5D5D9E5CDA44AA7FDCB214628319182ED52CD264A385113C40EBEDB0CDFA4A20E1C3AA4E3ADD40FE0C8CDA44A79D5C15FFDCB214EF5CC7D4AF1C48F4ACDFA4A20E8C9CD5F4EC804B113C40BEC8EBEDA0EBE018F7CD5B4EC84B113B40EB9EBBEC8EBEDA8EBE018F7F7D9D5D9C160C52A7B40E5113C40EDB0E1C1C500000000D9C5D9D1C1C920E7E81BB3827B3D77231C10F418D7E3D913033E2903C772310F311D840213C40140EDB0C92B160193E76EDB9C90002A7B4011210FDCB214620319182ED52227B40D915D9C91B1B112101811910FD227B40C940C9C9113C40EBC9EBCDEF4011D84063D5CD842CD5A4CE11E3D51605EC5CD5B45C1237B237A23D11D20ECCD5B4BCD4C4920D5C90006CA97C5ED5B3C40CB4FC4D24B65CD69452A3E40CB4F208ED52309CBC718519302CB87223E40EBCB47C4D24B65CD69452A3C40CB472071930ACB8F186ED52302CBCF223C40F5ED5B4240CDBB4132454097B22018ED5B40402A3E40CDBB4132444097B2207ED4B4440CDD94BF1C1108DC921FFFFED52EBC9972148405E2356EBED42C8EB702B713E3FB9D83E2FB8D8CDED44C91B32343B6E4935372EC547283138B441343A39CF4829372656422B2E31314E372A26CA442E3319A248372A385F44382837A0413A33295D42282E3749423A33285042312A2B644C372E2C684C322E296C4C302A3E9341352635394E3A3335354E283435474E1B213C4070237023E5C1C93E21863E11823E4322140C3EF4C2A3C4097E5CD013BADC44422AD84062EBED524D44E1C9D5CDCD41CD141CD2242FEDC42C42CD1C42CD2849C620CD2C44D17D12137C12132AD440C9CDE24CC87EF5CD3B49C52A3C40E5CDB47E1C178B1202F1C9E5C5CD1D47C1E1F1E5C5CD3344C1D1232323CD5747C90002A3E403A3C40BDC03A3D40BCC9EBCDEF40113C40CD8B4CCD8B4C11D84061FDCB21562814CD842CDB04CCD3A4DCD1D4DCD4F4DCD4C4920D7C9FDCB2146C8CD744C304CDB47C9CD344D4B42CD60AC92371237023C9FDCB214EC8CD744CD8C54B42CD344D9C1CD60AC9FDCB2156C8CD224D21D8407E23BE3872A3C40CDB47C9477E902B77CD3F4DC9CDBB2444D513E014C8CDBD77EC9CDCD41CD141CD2242FED20DCD1C42CD2849C620CD2C4437C9CD2A44373FC9CD24ED8237E060CDC242CD264AC91CEBCDEF40FDCB2146F528B11D84062CD8422AD440CD7E4D3818F120ACD6F4DD61C30197187CD9E4D7E30197CD9344C9CDB47F1287CD9E4D7ED8185CD6F4DB7C8110CD1A472AD64023232377C921D8403E20BED84E3E0B93FC9FDCB21462837723C9FDCB214E287BE20236023C9F597BE204F17723C9F123C93E11853E218197FD7721C37A42EBCD4841C8CF1BCD404E1618C36B8CD404E2139403621233618C92B16019533E76BEC8979228336015FDCB214E2822B2B23D28218E73E753CC91BD511210FDCB214628319182ED52D1C9D5E5606911210ED527CB5444DE1D1C9C5E59743772310FCE1C1C9E1D1D54211210FDCB21462091811910FD184ED5210FCD1C178B1C8D5CD264AD1383CD9F4ECD8F4EC815C8CD7E4E18EB1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B 1 LET A$="" 2 LET B$="" 3 LET C$="" 4 LET D$="" 5 LET E$="" 6 LET F$="" 7 LET G$="" 9 LET A=0 10 GOSUB 0 11 REM OUT;219,0,223,0,219,7,223,254,219,8,223,15,:FILL;1,25,1,33,##,2,24,2,32,(A),:DRAW;14,44,4,44,4,28,14,28,:DRAW;5,36,14,36,:DRAW;15,43,15,37,:DRAW;15,35,15,29,:DRAW;18,28,18,43,:DRAW;19,44,28,44,:DRAW;29,43,29,28,:DRAW;19,36,28,36,:DRAW;43,44,33,44,:DRAW;32,43,32,37,:DRAW;33,36,42,36,:DRAW;43,35,43,29,:DRAW;42,28,32,28,:DRAW;46,44,46,28,:DRAW;59,44,50,44,:DRAW;49,43,49,29,:DRAW;50,28,59,28,:FILL;12,23,3,31,% ,13,16,10,23,@@,:RESTORE;4000,:READ;A$,B$,C$,D$,E$,F$,G$, 20 FOR N=1 TO 40 25 PRINT AT 16,13;;B$;AT 20,8;C$;AT 13,10;D$;AT 18,5;E$;AT 13,10;F$;AT 18,5;G$ 26 LET K=6*N 28 GOSUB 0 29 REM OUT;219,0,223,K, 30 NEXT N 40 GOSUB 0 41 REM OUT;219,7,223,255,:CLS:FIL;1,25,1,2,% ,2,25,2,3,% ,3,25,3,4,% ,4,25,4,5,% ,5,25,5,6,% ,6,25,6,7,% ,7,25,7,8,% ,8,25,8,9,% ,9,25,9,10,% ,10,25,10,11,% ,11,25,11,12,% ,12,25,12,13,% ,13,25,13,14,% ,14,25,14,15,% ,15,25,15,16,% ,16,25,16,17,% ,17,25,17,18,% ,18,25,18,19,% ,19,25,19,20,% ,20,25,20,21,% ,21,25,21,22,% ,22,25,22,23,% ,23,25,23,24,% , 44 GOSUB 0 45 REM FIL;1,25,32,33,% ,1,24,31,32,% ,1,23,30,31,% ,1,22,29,30,% ,1,21,28,29,% ,1,20,27,28,% ,1,19,26,27,% ,1,18,25,26,% ,1,17,24,25,% ,1,16,23,24,% ,1,15,22,23,% ,1,14,21,22,% ,1,13,20,21,% ,1,12,19,20,% ,1,11,18,19,% ,1,10,17,18,% ,1,9,16,17,% ,1,8,15,16,% ,1,7,14,15,% ,1,6,13,14,% ,1,5,12,13,% ,1,4,11,12,% ,1,3,10,11,% ,18,25,1,10,##,1,8,24,33,##,9,17,12,22,##, 50 FOR S=1 TO 6 51 FOR K=1 TO 6 52 GOSUB 0 53 REM FIL;10,11,14,20,.',10,16,20,21,.',15,16,14,20,.',10,16,13,14,.',2,6,15,23,: ,20,24,11,19, :,2,7,25,32,(A),19,24,2,9,% ,8,17,2,7,<,9,18,27,32,>,1,3,1,10,!!,23,25,24,33,;;, 55 PRINT AT 11,14;"DEMO";AT 12,14;"%F%I%L%L" 56 GOSUB 0 57 REM FIL;10,11,14,20,'.,10,16,20,21,'.,15,16,14,20,'.,10,16,13,14,'.,2,6,15,23, :,20,24,11,19,: ,2,7,25,32,% ,19,24,2,9,(A),8,17,2,7,>,9,18,27,32,<,1,3,1,10,;;,23,25,24,33,!!, 58 NEXT K 60 FOR K=1 TO 6 61 GOSUB 0 62 REM FIL;10,11,14,20,.',10,16,20,21,.',15,16,14,20,.',10,16,13,14,.',2,6,15,23,: ,20,24,11,19, :,8,17,2,7,<,9,18,27,32,>,1,3,1,10,!!,23,25,24,33,;;, 63 PRINT AT 11,14;"%D%E%M%O";AT 12,14;"FILL" 64 GOSUB 0 65 REM FIL;10,11,14,20,'.,10,16,20,21,'.,15,16,14,20,'.,10,16,13,14,'.,2,6,15,23, :,20,24,11,19,: ,8,17,2,7,>,9,18,27,32,<,1,3,1,10,;;,23,25,24,33,!!, 66 NEXT K 68 NEXT S 80 GOSUB 0 81 REM FIL;9,17,8,26,##,10,16,9,25,(A), 82 PRINT AT 10,9;"THIS PROGRAM";AT 12,11;"RUNS IN";AT 14,18;"%B%A%S%I%C" 85 LET S=1 86 GOSUB 0 87 REM FIL;1,3,1,10,*,23,25,24,33,*,2,8,24,32,':,18,24,2,10,:.,8,17,2,7,*,9,18,27,32,*, 88 PRINT AT 14,9;"%E%X%T%E%N%D%E%D" 89 GOSUB 0 90 REM FIL;2,8,24,32,(A),23,25,24,33,##, 91 PRINT AT 3,25;"DRAW";AT 3,10;"%I%N";AT 20,20;"%O%U%T" 92 GOSUB 0 93 REM FIL;8,17,2,7,(A),9,18,27,32,(A), 94 PRINT AT 14,9;"% % % % % % % % ";AT 9,3;"%R";AT 10,3;"%E";AT 11,3;"%A";AT 12,3;"%D";AT 10,28;"%D";AT 11,28;"%A";AT 12,28;"%T";AT 13,28;"%A" 95 GOSUB 0 96 REM FIL;18,24,2,10,(A),1,3,1,10,##, 97 PRINT AT 20,2;"UNDRAW" 98 PRINT AT 14,9;"%E%X%T%E%N%D%E%D" 108 LET S=S+1 109 IF S<11 THEN GOTO 86 110 PRINT AT 6,16;"SCROLL";AT 17,11;"FILL";AT 2,1;"RESTORE";AT 21,24;"CLS" 115 GOSUB 0 116 REM FIL;11,14,10,24,% ,15,16,10,24,(A), 120 PRINT AT 11,9;"EXTENDED BASIC" 300 FOR W=0 TO 2 310 GOSUB 7100 320 NEXT W 500 GOSUB 0 501 REM CLS:DRAW;7,45,2,45,2,38,7,38,:DRAW;8,44,8,39,:DRAW;7,33,2,33,2,26,:DRAW;8,32,8,30,:DRAW;8,28,8,26,:DRAW;3,29,7,29,:DRAW;7,21,3,21,:DRAW;2,20,2,14,:DRAW;8,20,8,14,:DRAW;3,17,7,17,:DRAW;2,9,2,3,:DRAW;3,2,4,2,:DRAW;5,3,5,5,:DRAW;6,2,7,2,:DRAW;8,3,8,9,:DRAW;60,45,55,45,55,38,60,38,:DRAW;61,44,61,39,:DRAW;61,33,55,33,55,26,61,26,:DRAW;56,30,59,30,:DRAW;55,20,55,14,:DRAW;56,21,57,21,:DRAW;58,20,58,14,:DRAW;59,21,60,21,:DRAW;61,20,61,14,:DRAW;60,9,56,9,:DRAW;55,8,55,3,:DRAW;56,2,60,2,:DRAW;61,3,61,8,:DRAW;0,47,63,47,63,0,0,0,0,46, 524 LET S=0 525 GOSUB 0 526 REM FILL;2,24,6,28,(A),:DRAW;10,45,53,2,:DRAW;53,45,10,2,:DRAW;27,45,36,45,:DRAW;36,44,27,35,:DRAW;27,34,36,34,:DRAW;37,13,26,2,:DRAW;26,13,37,2,:DRAW;18,31,13,31,:DRAW;12,30,12,24,19,24,19,30,:DRAW;11,23,11,17,:DRAW;12,16,19,16,:DRAW;20,17,20,23,:DRAW;48,16,48,31,46,29, 527 LET S=S+1 528 IF S<16 THEN GOTO 525 547 LET S=0 548 GOSUB 0 549 REM FILL;2,24,6,28,(A),:DRAW;33,23,33,22,30,22,30,25,35,25,35,20,28,20,28,27,37,27,37,18,26,18,26,29,39,29,39,16,24,16,24,31,41,31,41,14,22,14,22,33,43,33,43,12,20,12,20,35,45,35,45,10,18,10,18,37,47,37,47,8,16,8,16,39,49,39,49,6,14,6,14,41,51,41,51,4,12,4,12,43,53,43,53,2,10,2,10,45,53,45, 550 GOSUB 0 551 REM PRINT AT;12,13,A$,:UNDRAW;33,23,33,22,30,22,30,25,35,25,35,20,28,20,28,27,37,27,37,18,26,18,26,29,39,29,39,16,24,16,24,31,41,31,41,14,22,14,22,33,43,33,43,12,20,12,20,35,45,35,45,10,18,10,18,37,47,37,47,8,16,8,16,39,49,39,49,6,14,6,14,41,51,41,51,4,12,4,12,43,53,43,53,2,10,2,10,45,53,45, 552 LET S=S+1 553 IF S<6 THEN GOTO 548 574 FOR K=1 TO 3 575 GOSUB 0 576 REM FILL;2,24,6,28,(A),:DRAW;13,42,49,42,49,6,13,6,13,41,:DRAW;25,41,25,7,:DRAW;37,41,37,7,:DRAW;14,30,48,30,:DRAW;14,18,48,18, 579 FOR M=1 TO 3 580 GOSUB 0 581 REM DRAW;46,39,40,33,:DRAW;40,39,46,33,:DRAW;28,39,28,33,34,33,34,39,29,39,:DRAW;46,27,40,21,:DRAW;40,27,46,21,:DRAW;40,15,40,9,46,9,46,15,41,15,:DRAW;34,27,28,21,:DRAW;28,27,34,21,:DRAW;16,27,16,21,22,21,22,27,17,27,:DRAW;22,15,16,9,:DRAW;16,15,22,9, 585 FOR N=1 TO 4 590 GOSUB 0 591 REM DRAW;40,39,46,33,:DRAW;46,39,40,33,:DRAW;28,27,34,21,:DRAW;34,27,28,21,:DRAW;16,15,22,9,:DRAW;22,15,16,9, 592 GOSUB 7100 595 GOSUB 0 596 REM FIL;4,9,20,25,(A),10,15,14,19,(A),16,21,8,13,(A), 600 FOR W=1 TO 5 601 NEXT W 605 NEXT N 625 GOSUB 0 626 REM FIL;4,9,14,19,(A),10,15,8,13,(A),16,21,20,25,(A),10,15,20,25,(A), 630 FOR W=1 TO 5 631 NEXT W 640 NEXT M 645 NEXT K 700 GOSUB 0 701 REM CLS 705 FOR N=1 TO 10 710 GOSUB 0 711 REM SCROLL;10,:DRAW;17,12,11,12,11,0,17,0,:DRAW;18,11,18,1,:DRAW;29,12,22,12,22,0,29,0,:DRAW;23,6,29,6,:DRAW;33,11,33,0,:DRAW;34,12,36,12,:DRAW;37,11,37,0,:DRAW;38,12,40,12,:DRAW;41,11,41,0,:DRAW;45,11,45,1,:DRAW;46,0,51,0,:DRAW;52,1,52,11,:DRAW;51,12,46,12,:SCROLL;10,:DRAW;10,12,4,12,:DRAW;3,11,3,7,:DRAW;4,6,9,6,:DRAW;10,5,10,1,:DRAW;9,0,3,0,:DRAW;20,12,14,12,:DRAW;13,11,13,1,:DRAW;14,0,20,0,:DRAW;29,12,23,12,23,0,:DRAW;30,11,30,7,:DRAW;29,6,24,6,:DRAW;30,5,30,0,:DRAW;33,11,33,1,:DRAW;34,0,39,0,:DRAW;40,1,40,11,:DRAW;39,12,34,12,:DRAW;43,12,43,0,50,0,:DRAW;53,12,53,0,60,0,:SCROLL;2, 712 GOSUB 7100 714 NEXT N 750 PRINT AT 0,0;"%6%,%0%0%0% %C%H%R%.%/%S%E%C% %I%N% %E%X%T%E%N%D%E%D% %B%A%S%I%C" 755 FOR N=1 TO 10 800 GOSUB 0 811 REM FIL;2,25,1,33,0,2,25,1,33,1,2,25,1,33,2,2,25,1,33,3,2,25,1,33,4,2,25,1,33,5,2,25,1,33,6,2,25,1,33,7,2,25,1,33,8,2,25,1,33,9,2,25,1,33,A,2,25,1,33,B,2,25,1,33,C,2,25,1,33,D,2,25,1,33,E,2,25,1,33,F,2,25,1,33,G,2,25,1,33,H,2,25,1,33,I,2,25,1,33,J,2,25,1,33,K,2,25,1,33,L,2,25,1,33,M,2,25,1,33,N,2,25,1,33,O,2,25,1,33,P,2,25,1,33,Q,2,25,1,33,R,2,25,1,33,S,2,25,1,33,T,2,25,1,33,U,2,25,1,33,V,2,25,1,33,W,2,25,1,33,X,2,25,1,33,Y,2,25,1,33,Z,2,25,1,33,(A), 812 FOR W=1 TO 10 813 NEXT W 815 NEXT N 816 GOSUB 0 817 REM CLS:RESTORE;4010,:READ;A$,B$,C$,S,:PRINT;A$,B$,:PRINT AT;15,11,C$,:OUT;219,7,223,199,219,8,223,16,219,9,223,16,219,10,223,16,219,12,223,40, 825 FOR N=1 TO S 850 GOSUB 0 851 REM OUT;219,13,223,0,:DRAW;32,0,N,45,:UNDRAW;32,0,N,45, 852 NEXT N 855 GOSUB 0 856 REM OUT;219,7,223,255, 860 GOSUB 0 861 REM FILL;1,25,1,33,@@, 862 FOR N=1 TO 17 863 GOSUB 0 864 REM MOVE;1,25,1,16,W,1,:MOVE;1,25,16,33,E,1, 865 NEXT N 870 FOR N=1 TO 50 STEP 2 872 GOSUB 0 873 REM CIRLE;N,N,N, 874 NEXT N 880 GOSUB 0 881 REM PAPER;1,25,1,33,%=,:UNPAPER;1,25,1,33,*, 890 GOTO 10 900 SAVE "DEM%O" 910 RUN 4000 REM DATA;%U%N%D%R%A%W,ZX-81,COPYRIGHT 1983,%U%P%-%-%G%R%A%D%I%N%G,AUTHOR:% % FRITS BENIEST,UP--GRADING,%A%U%T%H%O%R%:% % %F%R%I%T%S% %B%E%N%I%E%S%T, 4010 REM DATA;% % %S%H%O%O%T%I%N%G% %I%N% %E%X%T%E%N%D%E%D%-%B%A%S%I%C% % % % , '..''..''.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'..''.'.'.'.'.'. ******************************,:..:.:.:.:.:.:.:.:.:.:,63, 5000 REM DATA;2,5,1,205,1,146,1,89,0,201,3,8,3,209,3,209,0,201,3,209, 7005 LET J=0 7006 LET L=0 7007 GOSUB 0 7008 REM RESTORE;5000,:OUT;219,1,223,0,219,0,223,0,219,8,223,15,219,7,223,254, 7010 FOR N=1 TO 10 7020 GOSUB 0 7021 REM READ;L,J,:OUT;219,0,223,J,219,1,223,L, 7030 NEXT N 7040 GOSUB 0 7041 REM OUT;219,0,223,0,219,1,223,0,219,7,223,255, 7050 RETURN 7100 GOSUB 0 7101 REM OUT;219,7,223,254,219,8,223,15,219,1,223,0,219,0,223,0, 7110 FOR H=250 TO 0 STEP -80 7111 GOSUB 0 7112 REM OUT;223,H, 7120 NEXT H 7190 RETURN ```