Frackit

From Esolang
Jump to navigation Jump to search

Frackit is an esolang created by islptng. It operates on fractions. It has a stack.

Commands

Command Meaning
#n push(n) (n is a positive integer)
/ push(1/pop())
! pop()
< insert(0,pop())
> push(pop(0))
^ push(pop().denominator)
* push(pop()*pop())
: duplicate top of stack
% swap top 2 items
[code] execute code infinitely
(code1|code2) pop, if equal to 1, execute code1, else execute code2
+ continue
- break
, input a number(can be fraction or integer), push it
. pop a value and print it(as fraction or integer)
'c print c as a character

If the program begins with a number, the I/O will be modified to the number-base.
For example, if the program begins with 2, inputting 16 will cause 65536 to be pushed(2^16=65536); outputting 65536 will cause 16 to be printed.

Examples

Hello World

'H'e'l'l'o',' 'w'o'r'l'd'!'

Truth Machine

,(['1]|'0)

Cat

There's no current Cat Programs, since this language only allows you to input an any fraction, so the below one is actually a fraction cat.

[,.]

XKCD Random Number

#4.

Alternative:

'4

A+B problem

2,,*.

It supports any positive integers.

Interpreter

Try it online!