Fit

From Esolang
Jump to: navigation, search

Fit is an esoteric programming language by User:Madk which uses numbers in base 5 (termed 'fits') to compute things. Each fit contains a number between and including -2 through +2.

Commands

+	rotate current fit digit; -2 → -1; -1 → 0; 0 → 1; 1 → 2; 2 → -2
-	rotate fit backwards
~	negate fit
(	jump past the corresponding ) if the current cell = 0
)	jump back to matching ( if the current cell is ≠ 0
{	jump past matching } if the cell is ≥ 0
}	jump back to { if the cell is < 0
[	jump past matching ] if the cell is ≤ 0
]	jump back to [ if the cell is > 0
/	jump past matching \ if the cell is ≠ 0
\	jump back to / if the cell is = 0
?	skip the following instruction if the current cell is = 0
!	skip the following instruction if the current cell is ≠ 0
^	skip the following instruction if the current cell is > 0
v	skip the following instruction if the current cell is < 0
=	destroy the current cell, following cell takes place under the pointer and all following cells are shifted left once to fill the gap
<	move cell pointer left
>	move cell pointer right
_	set the ASCII byte counter to 0
,	add the current ternary cell to the ASCII byte counter
;	output the ASCII byte counter, which is always 59 (the ASCII value for the character ;) at program start
n	output a newline
.	output the number under the pointer
:	get input for the number under the pointer
#	begin/end comment


Examples

Hello, world!

++,,,,,,-,;_+,''',,,,,'+,-'-,;,+,,,;;,-,;_+,''',,,';_,'''';''+,,,,+,;-,,,,;-,-,;++,,,;,,,,;_-,''''-,;

Cat

+[>:.n<]

Quine

;


External resources

Download Fit interpreter