Primal

From Esolang
Jump to navigation Jump to search

Primal is a esolang that works using only two accumulators and is turing complete (unless I'm missing something)

Commands:

Command Description
> Increment accumulator 2
< Decrement accumulator 2 to a minimum of 1
+ multiple accumulator 1 by prime(accumulator 2)
- if accumulator 1 is divisible by prime(accumulator 2) divide it by said value, otherwise, NOP
. (prime(accumulator 2)^a|accumulator 1)}
, Multiply accumulator 1 by number of user's choice
[ accumulator 1, otherwise NOP
] Jump back to the matching [

Think about the prime factorization of accumulator 1 as a list and prime(accumulator 2) as a slot in rhat list, primal is basically brainfuck