Trawl

playground · v0.1.0

Trawl hunts for numbers that fit a rule. Change a number, press Run, and watch.

The programCtrl + Enter runs it
Catchesdiving: loading the interpreter…

Loading the hunter…

0catches
    Everything it printed
    See the code ↓
    How Trawl works, in one minute
    2 3 + .Numbers go on a pile (the stack). Words take numbers off the top and put results back. This prints 5. Also - * / % power and = < >.
    dup drop swap overcopy, throw away, or reorder the top numbers
    : sq dup * ;make your own word: now 12 sq gives 144
    c if A else B thendo A when c is not 0, otherwise B
    [ A ]loop: keep doing A while the top number is not 0
    1234 10 digsumthe digit sum in any base (10 here)
    42 7 bury · 7 digthe seabed: numbered memory cells, all 0 at the start
    lo hi echohave cells lo..hi looked exactly like this before? How many echoes ago?
    1 9 wave · wantguess a number, and rewind to the next guess when it turns out wrong
    . emit ." text"print a number, a character, some text