Twimp

From Esolang
Jump to navigation Jump to search

The Twimp programming language was invented by accident in 2004. Some information can be found in http://zzo38computer.org/esoteric/twimp/ But now I forget mostly how it works (but see the documentation and PHP code).

Features

  • There is no way to store numbers.
  • Input is a nybble at a time, but output is a byte at a time. This makes a cat program to be a bit long
  • If you type AVARTA KADAVRA then it returns a fatal error "Fatal: Bad Magic"
  • There are 4 built-in constants: ZERO (actually 1, to confuse you), ONE (actually 0, to confuse me), PI (set to 3, in case you are too much religious, and because only integers are supported), and HOURSINADAY (which can be used as a filter criterion, or at least could if the programming language had filter criteria).
  • Forced constants are in roman numerals
  • You can type a program without ever using the shift key
  • You can deal with "half-references" with the REF and PULL commands
  • The program can be drunk by using DRINK command
  • Duck-sauce replaces the entire equasion with zero

Preprocessor Commands

  • ABREV (abbreviation)
  • INSTRUCT
  • ACT
  • ACTS
  • NPR (Combination of NEW, PUSHLN, and RET)

Program Commands

  • RET
  • PUSHL
  • PUSHLN
  • OUT
  • POP
  • MOVE
  • KEYOUT
  • KEYIN

Examples

Copy input to output (cat):

NEW 1
NEW 2
PUSHLN 1
PUSHLN 2
-NO
NEW 3
COPY 1 2
MOVE 1 3
COPY 2 2
MOVE 2 3
COPY 3 2
COPY 3 []
NEW 4
FORGET
PUSHLN 4
STEP IV
POP 3 1
OF [6-[3]]
NEW 5
PUSHLN 5
RET 4
ON 5
OUT [[[=====]--[]]-16]
RET 2
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.