6π-b

From Esolang
Jump to navigation Jump to search

6π-b is an esoteric programming language where you write numbers in base π. Also, you write only with greek letters.

Commands

Command Description
λ Increment current π-nary digit
δ Decrement current π-nary digit
τ Choose left π-nary digit
θ Choose right π-nary digit
ι Output π-nary number
ω End

Programs

Output pi:

λι

Output 2pi²+pi:

λτλλι

Output 10 (10.0034763501):

ττλθθθθλθλθθθθδθδθδι

Output 4:

λθθλλθλλθθλθλλθλλθλθι

Interpreter

import math
def six_pi_minus_b(src):
    acc = 0
    ptr = 1
    for i in src:
        if i == 'λ': acc += math.pi ** ptr
        if i == 'δ': acc -= math.pi ** ptr
        if i == 'τ': ptr += 1
        if i == 'θ': ptr -= 1
        if i == 'ι': print(acc)
        if i == 'ω': return
six_pi_minus_b(input())