esolangs/subleq.bqn

19 lines
538 B
BQN
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Subleq interpreter
_while_ {𝔽𝔾𝔽_𝕣_𝔾𝔽𝔾𝕩}
ToNum {neg '-'=𝕩 (¯1neg)×10×+˜´·-'0'neg𝕩}
Subleq {
𝕊 memory:
{
𝕊 ipmem:
{
¯1b·: ip+3, (@-˜•term.CharB@)(b) mem;
a¯1·: •Out @+amem, ip+3, mem;
abc : d b-(mem)a, (0<d)c, ip+3, d(b) mem
} mem˜ip+3
} _while_ {𝕊 ipmem: ip0} 0memory
}
Subleq ToNum¨•args