Flux (Esolangist)

From Esolang
Jump to navigation Jump to search

Flux is a 2D esolang by User:Esolangist.

Flux (Esolangist)
Paradigm(s) Imperative? (I don't know what a paradigm is)
Designed by User:Esolangist
Appeared in 2025
Memory system Stack-based
Dimensions Two dimensions
Computational class I don't really know yet
Reference implementation None. This isn't implemented yet
Influenced by Befunge

Commands

v^<> work like in Befunge

+ adds top two stack values

S subtracts top two stack values, second-from-top first

* multiplies top two stack values

/ divides top two stack values (dividing by 0 raises an error

Don't divide by 0

)

: duplicates top of stack

0-9 push themselves

~ pops the top of stack

# skips the next cell

@ halts

" toggles string mode. AKA pushes everything until another "

. outputs the top of the stack as a number

, outputs the top of the stack as an ASCII character

? goes in a random direction (useful for random number generators...?)

& inputs a number and pushes it

' inputs an ASCII character and pushes it

= Pushes 1 if the top two stack values are the same, pushes 0 otherwise

! pushes 1 if top of stack is 0, otherwise push 0

% modulo

$ swaps top two stack values

{ and } Rotates the stack up and down 3 values respectively

[, ], ( and ) go left, right up and down respectively if top of stack is 0

g gets the top two values on the stack (call them x and y) and pushes the value at (x,y)

p pops x,y,z and writes z to (x,y)

x pops n, duplicates the top n values

- and | are mirrors

j pops x and y, jumps to (x,y)

£ skips the next instruction if the top of the stack isn't 0

l goes to the next e in the pointer's direction if the top value of the stack is 0

e goes back to the last l triggered if the top of the stack isn't 0

r pushes a random number between 0 and 255

m is a NOP, but it is useful (see R)

R goes back to the last m with the current direction

c destroys the stack

Examples

Hello world

>0"Hello, world!"l,e@

Cat

>l',e@

Truth machine

This one by User:Esolangist uses m and R.

&m£vv
  l0R
  1.
  .@
  e

XKCD random number

>4.@
Chosen by fair dice roll
Guaranteed to be random