A Logo interpreter with turtle graphics that runs entirely in the terminal, so it works over SSH and in any plain terminal window. It follows UCBLogo, uses only the Python standard library, and can turn a drawing into a 3D-printable stencil.
Try it in your browser, with nothing to install, or run it in your terminal as below.
The browser version, and a drawing in the terminal.
You need Python 3.10 or later. There is nothing to install. Each release also has termlogo.pyz, a single file you can download, chmod +x and run.
git clone https://github.com/andybateman/termlogo.git
cd termlogo
./bin/termlogo # interactive REPL
./bin/termlogo examples/flower.logo # run a program
./bin/termlogo -e 'repeat 36 [fd 30 rt 100]'
./bin/termlogo prog.logo -o out.png # export .svg, .png, .txt or .stlOn macOS or Linux with Homebrew:
brew tap andybateman/termlogo https://github.com/andybateman/termlogo
brew trust --formula andybateman/termlogo/termlogo # newer Homebrew refuses untrusted taps
brew install termlogoIn the REPL, type HELP for every command, HELP fd for one, and BYE to leave. Press Tab to complete names, Up to recall a command, and Escape to stop a running program.
Useful options: --speed 0 draws instantly, --render braille|half|kitty picks the renderer, --colour-mode terrapin switches to Terrapin colours, and --fit 1000 fits a textbook 1000x1000 window to the canvas.
- The full guide, below: key bindings, colour modes, stencils, what works and known issues
- Run it in your browser: the same engine through Pyodide, with an editor, examples and PNG/SVG/STL downloads (how it is built is in the Browser version section below)
- examples/: sample programs to run and change
- CHANGELOG.md: what changed in each version
- HANDOVER.md: open items and how to pick the project up
- LICENSE: MIT
A Logo interpreter with turtle graphics that runs entirely in the terminal. Python's built-in turtle needs a Tk window and PythonTurtle needs wxPython, so neither works over SSH or in a plain terminal. This one draws with Unicode Braille characters (2x4 dots per cell) in 24-bit colour, uses only the Python standard library (Python 3.10 or later), and follows UCBLogo behaviour by default. A selectable Terrapin colour mode supports its colour tutorial without changing existing programs.
./bin/termlogo # interactive REPL (canvas above, text log below)
./bin/termlogo examples/tree.logo # run a file, print the canvas
./bin/termlogo -e 'repeat 36 [fd 30 rt 100]'
./bin/termlogo prog.logo -i # continue in the REPL with the same workspace/picture
./bin/termlogo prog.logo -o out.svg # export (.svg, .png, .txt or .stl)
./bin/termlogo examples/flower.logo # watch it draw (default speed 5)
./bin/termlogo examples/flower.logo --speed 0 # draw instantly
./bin/termlogo --render half # braille | half | kitty | auto
./bin/termlogo --colour-mode terrapin # Terrapin tutorial colours and RGBA
./bin/termlogo prog.logo --fit 1000 # textbook programs: a 1000x1000 window fits the canvas
python3 -m unittest discover -s testsHomebrew: the formula lives in andybateman/homebrew-tap (moved there 2026-11-02; the copy in Formula/ here is the source it is bumped from):
brew install andybateman/tap/termlogoIt installs the source with Homebrew's Python 3.13 and a termlogo launcher. Each release needs Formula/termlogo.rb updated with the new tag URL and sha256 (curl -sL <tarball URL> | shasum -a 256).
Single file: tools/build_pyz.sh writes dist/termlogo.pyz, one 220 KB executable that runs anywhere Python 3.10 or later is installed, with no source tree or install: ./termlogo.pyz examples/flower.logo, or copy it onto your PATH as termlogo. Release pages carry a prebuilt copy (attach it with gh release upload vX.Y.Z dist/termlogo.pyz). It still needs Python; it is not a standalone binary.
Options: --render, --speed 0-10 (default 5; 0 draws instantly), --colour-mode/--color-mode ucblogo|terrapin (default ucblogo), --stencil-opt KEY=VALUE, --size COLSxROWS, --scale S (pixels per turtle step, default 1; use 0.5 for drawings built for a 400x400 screen), --fit N (scale so an N x N Logo window fits the canvas; see below), --no-color/--no-colour, --no-canvas. REPL: Tab completes names, history is kept in ~/.termlogo_history, BYE or Ctrl-D leaves.
Inside the REPL, HELP lists every command by category, HELP fd or HELP "turtle explains one, and Tab completes command names, your own procedures and :variables. PRINT VERSION (or --version) shows the version and author.
Renderers (--render, or TERMLOGO_RENDER; auto is the default):
kitty: one real-pixel image per frame with anti-aliased lines, for terminals that speak the Kitty graphics protocol (Ghostty, Kitty, WezTerm).autopicks it when the terminal reports its pixel size; it is not used inside tmux or screen.half: solid half-block characters, 1x2 pixels per cell. Works in any terminal and has no gaps, but is a quarter of Braille's resolution.braille: 2x4 dots per cell. The most detail without graphics support, but lines look dotted.
A drawing keeps the same physical size in every renderer (one step is half a cell wide). In the Braille and half-block renderers the pen is a round brush as wide as SETPENSIZE (without anti-aliasing); Kitty paints anti-aliased, round-capped strokes.
Speed and input: SETSPEED 0-10 (or --speed) lets you watch it draw. The default is 5; 0 is instant and each step doubles the speed. Piped runs and exports do not animate, but SPEED still reports the chosen setting. Moves, turns and arcs are paced, with redraws at up to about 30 frames a second. Escape or Ctrl-C stops the current program, including WAIT and loops; at the prompt it cancels the input line. On macOS/Linux in a mouse-reporting terminal, click or left-drag on the canvas to reposition the turtle, including while idle. During drawing, its current movement ends there without drawing a connector, and the next Logo command continues from that point.
The macOS/Linux command pane accepts cursor keys, Home/End, Backspace/Delete, Tab completion and Up/Down history (see the key table below). It grows to display the whole command: source newlines occupy separate rows, and long lines wrap without changing the source. The startup version, help and mouse-selection guidance stays visible until the first command starts running, including while typing an unfinished multi-line command. Blank lines, comments and cancelled input do not dismiss it. Extra command rows use the output area first, then temporarily reduce the canvas; the picture is restored when editing ends. Commands taller than the terminal scroll to keep the editing cursor visible. --size still keeps a fixed canvas.
Up recalls a complete submitted command, including an entire multi-line REPEAT block or TO ... END definition. Down restores your unfinished draft. A recalled multi-line command can be edited in place from the keyboard:
| Key | In the command pane |
|---|---|
| Up, Down | Move between the lines of a multi-line command. From its first or last line, step through history |
| Ctrl-P, Ctrl-N or PageUp, PageDown | Always step through history, whatever line the cursor is on |
| Alt+Enter (Option+Enter) | Add a line break at the cursor. Shift+Enter does the same in terminals that report it, such as Ghostty and Kitty |
| Enter | Run the command, wherever the cursor is |
| Home, End (Ctrl-A, Ctrl-E) | Start or end of the current line; press again for the start or end of the whole command |
| Ctrl-U, Ctrl-K | Delete to the start or end of the current line |
Edits to a recalled command are kept while you look at other history entries, until you run something. Stored history is only changed by what you run. In macOS Terminal, Option+Enter needs "Use Option as Meta key" switched on.
Click any visible command row to edit it, including earlier continuation lines; this does not move the turtle. Mouse positions follow wrapping and window resizing. Canvas clicks and terminal resizes preserve your draft. READWORD and READLIST use the same mouse-aware input handling. History is saved as versioned JSON in ~/.termlogo_history; older readline history files still load, although their existing per-line entries remain separate. Long output is wrapped and paged in the REPL, so lists such as COLOURS can be read in full.
Pasting a program: in a bracketed-paste terminal such as Ghostty, a multi-line paste stays together in the editor. Press Enter to run it. Up then recalls the entire pasted program, including setup commands before a REPEAT block, rather than only the final block. Pasted tabs and line breaks are retained in the source; tabs are displayed as spaces. Commands entered separately remain separate history entries and can be reached with further Up presses.
Text selection: hold Shift while dragging to select terminal text, then use Cmd+C to copy on macOS. Ordinary clicks are reported to the app for canvas positioning and command editing; Ctrl-C still stops the program. Ghostty allows Shift-selection by default. If your configuration captures Shift-mouse too, mouse-shift-capture = never reserves it for native selection (see the Ghostty reference).
For the Terrapin colour lesson, start with ./bin/termlogo --colour-mode terrapin. The mode applies to scripts, exports and -i continuation too.
| Behaviour | UCBLogo mode (default) | Terrapin mode |
|---|---|---|
| Numbered colours | Original palette, initially 0-15 | Live WebLogo palette, 0-138; 138 is transparent |
| Colour names | Original Logo names | Web names, including both grey and gray, aqua and fuchsia |
| RGB inputs | [r g b], components 0-100 |
[r g b], components 0-255; optional fourth alpha 0-1 |
PC / PENCOLOR, BG / BACKGROUND |
Original input | Always [red green blue alpha] |
| Standalone reporters | Use PRINT or SHOW |
Values are printed, so PC, BG and COLOURS work on their own |
RANDOM n |
0 through n-1 | 1 through n, matching the lesson's random-colour examples |
The indexed palette was checked against live WebLogo and its published RGB table (as at 2026-10-06). COLOURS/COLORS lists names in index order; setpc random 138 selects indices 1-138, and setpc (random 139)-1 includes 0. Some older manual examples are inconsistent: the live palette's gold is index 59, while 60 is goldenrod.
SETPEN [penstate colour] changes the pen state and colour together. Use the full words PENUP, PENDOWN, PENERASE or PENREVERSE; PEN reports that state. In Terrapin mode, PD returns to ordinary painting, and FILL only runs with the pen in PENDOWN. (fill 0) stops at differing colours, default FILL crosses pixels with alpha below 0.5, and (fill 1) fills the whole canvas.
Alpha is composited over existing strokes and the current background, preserved through resizing, and retained in PNG/SVG exports. SETBG does not alter existing artwork. SETALPHA changes the default alpha for subsequent pen colour inputs; explicit RGBA inputs override it, while background colours default to alpha 1. The initial Terrapin state is a black pen on transparent white. Terminal renderers display transparency against white when no opaque background is set.
For example, in Terrapin mode:
setpencolour [255 0 0 0.5]
pencolour
setpen [pendown royalblue]
setbg [240 248 255]
repeat 4 [fd 20 rt 90]
pu setxy 7 7 pd setpc "pink fill
background
colours
This is colour-focused compatibility, not a complete Terrapin interpreter. Browser undo controls, background images and patterns are not implemented. UCBLogo's PALETTE and SETPALETTE remain available only in UCBLogo mode.
3D-printable stencil: STENCIL "plate (or (stencil "plate [thickness 1.6 margin 10]), SAVEPICT "plate.stl, or -o plate.stl) turns the pen strokes into slots cut through a flat plate and writes a binary STL. STENCIL adds the .stl extension when the name lacks it; SAVEPICT and -o choose the format from the extension, so they need it. One step is 1 mm and pen size is the slot width (SETPENSIZE 2 cuts 2 mm slots; fractions work). Parts that would fall out, such as the centre of an O, are tied back with bridges automatically. Options: thickness 1.2, margin 8, bridge 1.6, bridges 2, width (force every slot), minwidth 0.8, plate [w h], mirror true, pitch 0.2, mm 1, maxgap 15. Try termlogo examples/stencil_demo.logo -o demo.stl. Slots narrower than 0.8 mm are widened, and islands smaller than 1 mm2 are filled in, with a warning for each. Text from LABEL and erased or reversed strokes are not part of the stencil.
Filled areas are cut out. FILL removes the whole area enclosed by the pen lines drawn before it, and FILLED colour [instructions] removes the shape the turtle traces, with the pen up or down. Anything left standing inside a cut-out is an island and is bridged like any other, up to maxgap. A FILL is left out, with a warning, when its area is not closed off by pen lines (on screen the canvas edge can bound a fill; on the plate nothing would) or when the turtle is sitting on a line. The fill colour makes no difference. Try termlogo examples/stencil_fill.logo -o fill.stl.
An 80x24 terminal gives the REPL a 160x64 pixel Braille canvas centred on (0,0), so coordinates run about -80..80 across and -32..32 up. The canvas follows terminal resizing, both at the prompt and while running a program. The scale, turtle state, strokes and labels are retained; artwork clipped by a smaller window reappears when it grows again. --size fixes the canvas dimensions. Larger terminals or --scale give more room. WINDOW mode (the default) lets the turtle roam off-screen, as in UCBLogo.
Textbook coordinates: programs written for a 1000x1000 Logo window run unchanged with --fit 1000 (or FITWINDOW 1000), which scales the drawing so that window fits the canvas, whatever its size. The fit is kept when the terminal is resized. Pen sizes are in pixels and are not scaled by it. --scale and SETSCALE remain for choosing a fixed number of pixels per step; SETSCALE also ends a FITWINDOW.
Rendered with ./bin/termlogo examples/NAME.logo --speed 0 --size 100x40 -o docs/images/NAME.png. The examples start with FITWINDOW, so they fit any canvas size.
![]() flower |
![]() tree |
![]() koch |
![]() spiral |
![]() stars |
![]() stencil_demo |
![]() stencil_fill (FILL/FILLED cut-outs) |
- Language:
TO ... END(with optional[:x default]and[:rest]inputs), variables scoped the Logo way, so a called procedure can see its caller's (MAKE,LOCAL,LOCALMAKE,THING,NAME,GLOBAL), infix operators+ - * / ^ = <> < > <= >=with Logo's unary-minus spacing rule, parenthesised variadic calls,|word with spaces|, comments, line continuation with~. - Control:
REPEAT FOREVER REPCOUNT IF IFELSE TEST IFTRUE IFFALSE WHILE UNTIL DO.WHILE DO.UNTIL FOR STOP OUTPUT RUN RUNRESULT CATCH THROW ERROR WAIT BYE, plusFOREACH MAP FILTER FIND REDUCE APPLY INVOKEwith?/?1/?2slots, procedure names and[[a b] body]lambdas. - Data:
WORD LIST SENTENCE FPUT LPUT COMBINE FIRST LAST BUTFIRST BUTLAST ITEM COUNT MEMBER REVERSE REMOVE REMDUP PICK ISEQ RSEQ UPPERCASE LOWERCASE CHAR ASCIIand the predicates (EMPTYP LISTP WORDP NUMBERP MEMBERP EQUALP BEFOREP NAMEP PROCEDUREP PRIMITIVEP). - Maths:
SUM DIFFERENCE PRODUCT QUOTIENT REMAINDER MODULO INTQUOTIENT MINUS ABS INT ROUND SQRT POWER EXP LN LOG10 PI SIN COS TAN ARCTAN ARCSIN ARCCOS RANDOM RERANDOM AND OR NOT BITAND BITOR BITXOR ASHIFTand the comparison words. Trig is in degrees. - Turtle:
FD BK LT RT PU PD HOME CS CLEAN SETPOS SETXY SETX SETY SETH ARC DOT HT ST FILL FILLED LABEL WRAP WINDOW FENCE(FILLEDfills the polygon through the points the turtle visits and outlines it in the pen colour, as UCBLogo does), pen modesPPT PE PX,SETPC SETBG SETPEN SETPENSIZE SETPALETTE, and the queriesPOS XCOR YCOR HEADING TOWARDS DISTANCE SHOWNP PENDOWNP PEN PENCOLOR/PENCOLOUR BACKGROUND WRAPP COLOURS/COLORS. Colour inputs follow the selected mode described above. US and NZ spellings are accepted, includingSETPENCOLOR/SETPENCOLOURandSETSCREENCOLOR/SETSCREENCOLOUR. - Arrays:
{a b c}literals (and{a b c}@0for another origin),ARRAY MDARRAY LISTTOARRAY ARRAYTOLIST ARRAYP SETITEM MDITEM MDSETITEM, andITEM COUNT FIRST LAST PICK MEMBERPalso work on arrays. Arrays are shared, not copied, and equal only to themselves. - Property lists:
PPROP GPROP REMPROP PLIST PLISTS PPS ERPS.ERALLerases them too. - Workspace:
PO POTS PONS ERASE ERALL DEFINE TEXT SAVE LOAD,PRINT TYPE SHOW READWORD READLIST. - Files:
OPENREAD OPENWRITE OPENAPPEND OPENUPDATE CLOSE CLOSEALL ALLOPEN SETREAD SETWRITE READER WRITER READPOS SETREADPOS WRITEPOS SETWRITEPOS EOFP FILEP ERASEFILE. AfterSETREAD,READWORD READLIST READCHAR READCHARSread from the file, and afterSETWRITE,PRINT TYPE SHOWwrite to it;SETREAD []andSETWRITE []go back to the keyboard and screen. Files still open when Logo ends are closed then. - Keys:
READCHAR READCHARS KEYP. In the REPL they take keys straight from the keyboard while a program runs (Enter gives a newline; Escape or Ctrl-C stops the program). Piped input is read a character at a time. - Text cursor:
CURSOR,SETCURSOR [column row],CLEARTEXT. The REPL's text area under the canvas is five rows by the terminal's width, soSETCURSORplaces text within those (counting from 0) andPRINTorTYPEthen overwrite what is there. It lasts for one command; outside the REPL it is accepted and does nothing. - Jumps:
GOTO "tagandTAG "taginside a procedure (also from withinIF,REPEATand other lists), and.MAYBEOUTPUT, which outputs its input if it made one and otherwise behaves likeSTOP. - Tail calls: a final call in a procedure (also inside a final
IF/IFELSE, orOUTPUT proc ...) runs as a loop, soto loop ... loop endruns indefinitely in constant memory. Escape or Ctrl-C stops it in the terminal. Other recursion is capped at 25,000 levels and then reports "Stack overflow" (Python 3.10 stops sooner, after a few hundred levels, because deeper recursion would crash it; 3.11 or later is better). - Extensions:
SETSCALE n(same as--scale),FITWINDOW n(same as--fit),SETSPEED/SPEED,STENCIL,SAVEPICT "file.svg|png|txt|stl,HELP,VERSION.
The same Python engine runs in a web page through Pyodide (Python compiled to WebAssembly), in a Web Worker so a long drawing never freezes the page. Nothing is sent to a server.
python3 tools/build_web.py # builds dist/web (about 0.1 MB)
python3 -m http.server -d dist/web # then open http://localhost:8000Open it through a web server, not by double-clicking index.html (the page loads a module worker). Pyodide itself (about 12 MB) is loaded from the jsDelivr CDN on the first visit and cached by the browser after that. For a site that works offline or where the CDN is blocked, build with --bundle-pyodide (needs npm) to put a copy beside the page, or open the page with ?pyodide=https://... to use another address. docs/pages-workflow.yml is a ready-made workflow for publishing this repository's own GitHub Pages instead (it has to be moved to .github/workflows/ by someone whose token may push workflows).
Live copy: it is hosted at https://www.andybateman.com/termlogo/, as static files in the andybateman/andybateman.github.io repository. After you commit and push a change here, publish it with one command (it builds into the site checkout beside this one, commits and pushes; --no-push stops before pushing, and a path argument names a different site checkout):
tools/publish_site.shThe page shows the version, commit and date it was built from under its title, and https://www.andybateman.com/termlogo/config.json holds the same, so you can tell at a glance whether the live copy is behind this repository. The build is reproducible: the same commit gives the same files, so publishing twice changes nothing. GitHub Pages lets browsers keep files for ten minutes, so every file the page loads is requested as name?v=STAMP (a hash of the contents). After a publish, a browser that already has the old index.html can show the old page for up to ten minutes (a hard refresh, Cmd+Shift+R, skips the wait); everything else it loads is then fresh.
The page:
- The editor, the
?command line (with history) and the output are on the left; the canvas fills the rest. The canvas follows the size of its pane, one pixel per turtle step, so a bigger window gives more room to draw (up to 1920x1200 pixels; a larger pane stretches that picture). For more room, drag the divider between the editor and the canvas (double-click it to put it back), press Expand canvas to hide the editor, or use the full-screen button under the canvas. On a phone the canvas comes first, with the editor below it. - The toolbar has Run and Stop, Examples (picking one runs it), Open and Save for
.logofiles, Share, the speed, the UCBLogo/Terrapin colour switch, Clear (CS) and Reset (a fresh workspace). Ctrl+Enter (⌘+Enter) runs the program and Esc stops it. - Under the canvas: the status, which repeats the last error for when the editor is hidden; the turtle coordinates under the pointer; a Zoom chip when
FITWINDOWorSETSCALEhas changed the scale (click it forSETSCALE 1); and the downloads. - Help explains the basics and the keys, and searches a list of every command (the same table as
HELP). - The examples start with
FITWINDOW, so they fill whatever canvas they get. - Pictures are sent as the rows that changed, and the turtle and
LABELtext are drawn by the page, so animation keeps up with the set speed. - PNG downloads include
LABELtext (not the turtle), SVG downloads include it as text, and STL stencils work as in the terminal. - Share copies an address that holds your program after the
#(compressed), so it never reaches a server. Opening such a link loads the program into the editor but does not run it. READWORD,READLIST,READCHARandKEYPwork: lines come from the?box and keys from the canvas (click it first). Stop and Esc interrupt the program and keep your procedures and variables.
Typing into a running program and a gentle Stop need the page to be "cross-origin isolated", which GitHub Pages cannot arrange with headers. web/coi-sw.js is a small service worker that adds them, which costs one automatic reload on the first visit. If the browser will not run it (some private windows), or Python will not start with it, the page drops back to the plain mode and remembers that:
- input commands see the end of input, and Stop replaces Python, so procedures and variables are lost (the program text stays).
?nocoiin the address forces this mode.
Still different from the terminal:
SAVEPICTwrites to a hidden in-memory folder (use the download buttons).- The canvas changes size between runs. A window resized while a program runs stretches the picture until the run ends.
- Recursion that is not a tail call reports
Stack overflowmuch sooner than in the terminal: after about 140 levels when the call is inside an expression (output :n + sum :n - 1), and about 400 otherwise, because Python in the browser crashes if an error unwinds from deeper. Tail calls are unaffected. If Python does stop unexpectedly, the page restarts it and says so: procedures and variables are lost, and the program stays in the editor.
tools/web_smoke.mjs is an optional end-to-end check (Node, Chromium and playwright-core) that starts Python in the page and works through it as a person would: every example, the command line, downloads, Open and Save, sharing, input commands, Stop, the colour modes, the divider, full screen, and the layout on a small laptop and a phone. tools/web_screenshots.mjs, with the same setup, retakes the two screenshots above after the page changes.
- Text-screen windows beyond
CURSOR/SETCURSOR,DRIBBLE,SETPREFIXand directory commands (DIR,FILES), andEDIT. - A Braille cell can only show one colour, so where strokes of different colours meet inside one cell (2x4 pixels) the cell takes the most common colour.
--render halfand--render kittycolour every pixel. - Pen size is in pixels, not turtle steps, so
--fitand--scaledo not thicken lines. PENREVERSEXORs the pen colour with what is there, so crossing or overlapping reversed lines can cancel out, as in UCBLogo. Terrapin transparency is ignored while reversing.
| File | Purpose |
|---|---|
termlogo/lexer.py |
Tokeniser (words, nested lists, unary-minus rule, |words|) |
termlogo/interp.py |
Evaluator: scopes, procedures, infix parsing, templates |
termlogo/primitives_core.py |
Control, variables, procedures, I/O, workspace files |
termlogo/primitives_data.py |
Words, lists, arithmetic, logic |
termlogo/primitives_turtle.py |
Turtle and screen commands |
termlogo/web.py |
Glue for the browser version: a session that runs Logo and posts pictures, text and files to the page |
termlogo/primitives_ext.py |
Arrays, property lists, GOTO/TAG, .MAYBEOUTPUT, file streams, keys and the text cursor |
termlogo/arrays.py |
The array type, kept separate so the tokeniser can build {...} literals |
termlogo/turtle.py |
Turtle state, movement, WRAP/WINDOW/FENCE, colour parsing |
termlogo/colours.py |
Terrapin's indexed Web colours, RGB/RGBA parsing and alpha compositing |
termlogo/canvas.py |
Pixel canvas, anti-aliased lines, Braille, half-block and Kitty renderers, SVG/PNG/text export |
termlogo/renderers.py |
Terminal detection, renderer choice, canvas factory, frame composition |
termlogo/stencil.py |
Stencil engine: signed-distance field, bridging, marching squares, extrusion, STL |
termlogo/earcut.py |
Polygon-with-holes triangulation (port of the earcut algorithm) |
termlogo/helptext.py |
Help table (a unit test fails if any command lacks an entry) |
termlogo/repl.py, __main__.py |
REPL, Tab completion, paging, command line |
termlogo/values.py, errors.py, registry.py |
Logo data helpers, error and control-flow exceptions, the primitive registry |
bin/termlogo |
Launcher that runs from this folder without installing |
Formula/termlogo.rb |
Homebrew formula (tap this repository by URL) |
web/ |
The browser page: index.html (layout and Help), app.js (editor, canvas, divider, buttons, sharing), worker.js (Pyodide and input), coi-sw.js (service worker for shared memory), style.css, favicon.svg |
tools/publish_site.sh |
Builds the browser version into the andybateman.github.io checkout, commits and pushes it |
tools/update_formula.sh |
Points the Homebrew formula at a release (run it once the release's tag exists) |
tools/build_web.py |
Builds dist/web: the page, the package as termlogo.zip, the examples, the Help command list (help.json), and optionally a copy of Pyodide |
tools/web_smoke.mjs |
Optional end-to-end check of the browser version |
tools/web_screenshots.mjs |
Retakes the browser screenshots in docs/images/ (browser.png, browser-phone.png) |
tools/build_pyz.sh |
Builds the single-file dist/termlogo.pyz (git-ignored) |
examples/ |
flower, tree, koch, spiral, stars, stencil_demo, stencil_fill, ab_logo |
tests/test_logo.py |
Unit tests |
tests/test_terminal.py |
Resize, input and live pseudo-terminal regression tests |
tests/test_web.py |
The browser glue (termlogo/web.py) without a browser |
tests/test_build.py |
Builds the .pyz and runs it away from the source tree |
tests/test_colours.py |
Terrapin lesson, palette, transparency and compatibility regressions |
ruff.toml, requirements-dev.txt |
Project lint/format settings and pinned development tooling |
LICENSE |
MIT licence |
HANDOVER.md |
Open items with owners, decisions made and how to pick the project up |
MIT; see LICENSE. Copyright (c) 2026 Andy Bateman.
The interpreter needs no third-party packages. Ruff is a development-only dependency:
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements-dev.txt
.venv/bin/ruff check .
.venv/bin/ruff format --check .
.venv/bin/python -m unittest discover -s tests
sh -n bin/termlogo tools/build_pyz.shThe lint rules cover Python errors, unused names, imports and Bugbear checks. Formatting is checked separately. The terminal tests use isolated pseudo-terminals and temporary history files; they do not drive the current terminal.
- A tail call whose callee does not rebind the caller's variables keeps the caller's frame (in Logo a called procedure can see its caller's variables), so an endless loop that hops between differently named procedures grows slowly in memory. Self-recursive loops do not.
- Kitty graphics have been observed in Ghostty (as at 2026-10-06). Redraws now erase stale canvas text before placing the image, while retaining intentional
LABELtext. The latest repairs still need a visual check in a restarted session. If rendering misbehaves, run with--render halfor setTERMLOGO_RENDER=braille. - Stencils, including the fill cut-outs, are checked as watertight meshes, not yet test-printed or opened in a slicer.
- The stencil only bridges parts that are fully cut free. Parts joined to the plate by a hairline are not detected: a
FILLEDstar drawn with the pen up leaves its centre attached only at five points. Drawing it with the pen down cuts those joins, and the centre is then bridged properly. - REPL and script interactions are exercised in pseudo-terminals on macOS (Python 3.14), with text-cell checks for scrolling and overlays; these do not replace a physical rendering check.
print 3 -4treats-4as a separate number (UCBLogo's spacing rule), which surprises some people. Write3 - 4.








