{"id":195,"date":"2026-04-27T07:30:32","date_gmt":"2026-04-27T07:30:32","guid":{"rendered":"https:\/\/permacomputer.solarpunk.au\/?p=195"},"modified":"2026-04-27T07:30:32","modified_gmt":"2026-04-27T07:30:32","slug":"sketch-bas","status":"publish","type":"post","link":"https:\/\/permacomputer.solarpunk.au\/?p=195","title":{"rendered":"SKETCH.BAS"},"content":{"rendered":"\n<p>Please find reproduced here a working port of SKETCH for the TRS Model 100 to <a href=\"https:\/\/github.com\/slviajero\/tinybasic\" data-type=\"link\" data-id=\"https:\/\/github.com\/slviajero\/tinybasic\">Stefan\u2019s BASIC<\/a> for the Arduino micro-controller platform.<\/p>\n\n\n\n<p>Full code listing: <\/p>\n\n\n\n<p><a href=\"https:\/\/basiclang.solarpunk.au\/d\/15-sketchbas\">https:\/\/basiclang.solarpunk.au\/d\/15-sketchbas<\/a><\/p>\n\n\n\n<p>Please find the archive.org link to the 1984 book here:<\/p>\n\n\n\n<p><a href=\"https:\/\/archive.org\/details\/25GamesForYourTrs80Model100\/page\/n49\/mode\/1up\">https:\/\/archive.org\/details\/25GamesForYourTrs80Model100\/page\/n49\/mode\/1up<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Live Coding Session<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Video File<\/h3>\n\n\n\n<figure class=\"wp-block-video aligncenter\"><video height=\"720\" style=\"aspect-ratio: 1280 \/ 720;\" width=\"1280\" controls src=\"https:\/\/permacomputer.solarpunk.au\/wp-content\/uploads\/2026\/04\/sketch-final.mp4\"><\/video><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Peertube Streaming<\/h3>\n\n\n\n<div style=\"position: relative; padding-top: 56.25%;\"><iframe loading=\"lazy\" title=\"SKETCH.BAS Live Coding Session\" width=\"100%\" height=\"100%\" src=\"https:\/\/communitymedia.video\/videos\/embed\/fxLMzaGhwonxgerak6jJgr\" style=\"border: 0px; position: absolute; inset: 0px;\" allow=\"fullscreen\" sandbox=\"allow-same-origin allow-scripts allow-popups allow-forms\"><\/iframe><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">CODE LISTING<\/h2>\n\n\n\n<pre class=\"wp-block-code alignwide\"><code>10 REM ***********\n20 REM *         *\n30 REM * Sketch  *\n40 REM *         *\n50 REM ***********\n   \n55 REM *** Instructions ***\n   \n60 CLS:PRINT:PRINT\n70 PRINT TAB(12)\"Instructions?\"\n80 PRINT:PRINT TAB(16)\"(Y\/N)\"\n90 GET A$:IF A$=\"\" GOTO 90\n100 IF A$=\"Y\" OR A$=\"y\" THEN GOTO 110 ELSE GOTO 270\n110 CLS:PRINT:PRINT\n120 PRINT TAB(2)\"You may use either Sketch or Draft\"\n130 PRINT TAB(2)\"modes. Sketch uses a moving line to\"\n140 PRINT TAB(2)\"draw, while Draft draws lines between\"\n150 PRINT TAB(2)\"two points you specify by hitting \";CHR$(34);\"S\";CHR$(34);\".\"\n160 PRINT:PRINT TAB(1)\"= Hit any key for Sketch instructions =\";\n170 GET A$:IF A$=\"\" GOTO 170\n180 CLS:PRINT\n190 PRINT TAB(12)\"==  Sketch ==\"\n200 PRINT TAB(13)\"&#91;Controls:]\"\n210 PRINT TAB(2)\"Arrow Keys -- Change direction\"\n220 PRINT TAB(2)\"Number keys -- Slow down cursor\"\n230 PRINT TAB(2)CHR$(34);\"F\";CHR$(34);\" -- Return to top speed\"\n240 PRINT TAB(2)\"Space Bar -- Toggle cursor (ON)-(OFF)\"\n250 PRINT:PRINT TAB(11)\"== Hit any key ==\"\n260 GET A$:IF A$=\"\" GOTO 260\n    \n265 REM *** Set Delay ***\n    \n270 CLS:PRINT:PRINT\n280 PRINT TAB(6)\"Enter speed desired:\"\n290 PRINT\n300 PRINT TAB(6)\"&#91;1] Fast to &#91;9] Slow\"\n310 GET A$:IF A$=\"\" GOTO 310\n320 OG=VAL(A$)*10:IF OG&lt;1 GOTO 310\n330 DL=OG\n    \n335 REM ***  Choose Sketch or Draw Mode ***\n    \n340 CLS:PRINT:PRINT\n350 PRINT TAB(4)\"Do you want:\"\n360 PRINT:PRINT TAB(6)\"&#91;S]ketch mode\"\n370 PRINT TAB(6)\"&#91;D]raft mode\"\n380 GET A$:IF A$=\"\" GOTO 380\n390 IF A$=\"S\" OR A$=\"s\" GOTO 420\n400 IF A$=\"D\" OR A$=\"d\" GOTO 710\n410 GOTO 380\n420 CLS\n430 REM FOR N=1 TO VAL(RIGHT$(TIME$,2))\n440 REM DM=RND(1)\n450 REM NEXT N\n460 X=239:Y=63\n470 X1=INT(RND(X)*X)+1:Y1=INT(RND(X)*Y)+1\n480 COLOR 255: PLOT X1,Y1\n    \n485 REM *** Sketch Mode ***\n    \n490 GET A$\n500 X1=X1+XD:IF X1>239 THEN X1=239\n510 IF X1&lt;0 THEN X1=0\n520 Y1=Y1+YD:IF Y1>63 THEN Y1=63\n530 IF Y1&lt;0 THEN Y1=0\n540 DELAY DL*10\n550 IF FLAG&lt;>1 GOTO 570\n560 COLOR 255:PLOT X1,Y1:DELAY 100:NEXT N:COLOR 0:PLOT X1,Y1:GOTO 580\n570 COLOR 255:PLOT X1,Y1\n580 IF A$=\"\" GOTO 490\n590 IF VAL(A$)&lt;1 GOTO 610\n600 DL=DL*VAL(A$)\n610 IF A$=\"F\" OR A$=\"f\" THEN DL=OG\n620 A=ASC(A$)\n630 IF A&lt;>32 GOTO 650\n640 IF FLAG=1 THEN FLAG=0 ELSE FLAG=1\n    \n650 IF A=4 GOTO 670\n651 IF A=5 GOTO 690\n652 IF A=19 GOTO 680\n653 IF A=24 GOTO 700\n654 GOTO 490\n    \n655 REM *** Change direction of Cursor ***\n    \n660 REM ON A-27 GOTO 670, 680, 690, 700\n670 YD=0:XD=1:GOTO 490 REM RIGHT\n680 YD=0:XD=-1:GOTO 490 REM LEFT\n690 XD=0:YD=-1:GOTO 490 REM UP\n700 YD=1:XD=0:GOTO 490 REM DOWN\n    \n705 REM *** Draft  Mode ***\n    \n710 X1=40:Y1=40\n720 CLS\n730 GET A$\n740 X1=X1+XD:IF X1>239 THEN X1=239\n750 IF X1&lt;0 THEN X1=0\n760 Y1=Y1+YD:IF Y1>63 THEN Y1=63\n770 IF Y1&lt;0 THEN Y1=0\n780 DELAY DL*10\n790 COLOR 255:PLOT X1,Y1\n800 DELAY 50\n810 COLOR 0:PLOT X1,Y1\n820 IF A$=\"\" GOTO 730\n830 IF A$=\"S\" or A$=\"s\" GOTO 850\n840 GOTO 990\n    \n845 REM *** Set one point ***\n    \n850 PO=PO+1\n860 COLOR 255:PLOT X1,Y1\n870 IF PO=1 THEN X2=X1:Y2=Y1:GOTO 730\n    \n875 REM ***  Draw Line ***\n    \n880 LINE X1,Y1,X2,Y2\n890 PO=0\n900 GET A$:IF A$=\"\" GOTO 900\n910 IF A$=\"S\" OR A$=\"s\" GOTO 950\n920 A=ASC(A$)\n930 IF A&lt;>4 AND A&lt;>5 AND A&lt;>19 AND A&lt;>24 GOTO 900\n940 GOTO 980\n950 PO=1\n960 X2=X1:Y2=Y1\n970 GOTO 900\n    \n975 REM *** Change Cursor Direction ***\n\n980 IF A=4 GOTO 990 REM RIGHT\n981 IF A=5 GOTO 1010 REM UP\n982 IF A=19 GOTO 1000 REM LEFT\n983 IF A=24 GOTO 1020 REM DOWN\n984 GOTO 900\n990 YD=0:XD=1:GOTO 730\n1000 YD=0:XD=-1:GOTO 730\n1010 XD=0:YD=-1:GOTO 730\n1020 YD=1:XD=0:GOTO 730\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"1024\" src=\"https:\/\/permacomputer.solarpunk.au\/wp-content\/uploads\/2026\/04\/b6950361ac23de27-768x1024.jpg\" alt=\"\" class=\"wp-image-199\" srcset=\"https:\/\/permacomputer.solarpunk.au\/wp-content\/uploads\/2026\/04\/b6950361ac23de27-768x1024.jpg 768w, https:\/\/permacomputer.solarpunk.au\/wp-content\/uploads\/2026\/04\/b6950361ac23de27-225x300.jpg 225w, https:\/\/permacomputer.solarpunk.au\/wp-content\/uploads\/2026\/04\/b6950361ac23de27-1152x1536.jpg 1152w, https:\/\/permacomputer.solarpunk.au\/wp-content\/uploads\/2026\/04\/b6950361ac23de27-1536x2048.jpg 1536w, https:\/\/permacomputer.solarpunk.au\/wp-content\/uploads\/2026\/04\/b6950361ac23de27-scaled.jpg 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Please find reproduced here a working port of SKETCH for the TRS Model 100 to Stefan\u2019s BASIC for the Arduino micro-controller platform. Full code listing: https:\/\/basiclang.solarpunk.au\/d\/15-sketchbas Please find the archive.org link to the 1984 book here: https:\/\/archive.org\/details\/25GamesForYourTrs80Model100\/page\/n49\/mode\/1up Live Coding Session Video File Peertube Streaming CODE LISTING<\/p>\n","protected":false},"author":1,"featured_media":196,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Please find reproduced here a working port of SKETCH for the TRS Model 100 to Stefan\u2019s BASIC for the Arduino micro-controller platform.","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[9,25],"tags":[15,27,29,26],"class_list":["post-195","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-archeology","category-videos","tag-retrogaming","tag-stefans-basic","tag-trs-80","tag-videos"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/permacomputer.solarpunk.au\/wp-content\/uploads\/2026\/04\/25-games-for-your-trs-80-model-100_0050.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/permacomputer.solarpunk.au\/index.php?rest_route=\/wp\/v2\/posts\/195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/permacomputer.solarpunk.au\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/permacomputer.solarpunk.au\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/permacomputer.solarpunk.au\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/permacomputer.solarpunk.au\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=195"}],"version-history":[{"count":3,"href":"https:\/\/permacomputer.solarpunk.au\/index.php?rest_route=\/wp\/v2\/posts\/195\/revisions"}],"predecessor-version":[{"id":201,"href":"https:\/\/permacomputer.solarpunk.au\/index.php?rest_route=\/wp\/v2\/posts\/195\/revisions\/201"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/permacomputer.solarpunk.au\/index.php?rest_route=\/wp\/v2\/media\/196"}],"wp:attachment":[{"href":"https:\/\/permacomputer.solarpunk.au\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/permacomputer.solarpunk.au\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/permacomputer.solarpunk.au\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}