From 105d75c69dc5977b140d9af77303ff986f399dbe Mon Sep 17 00:00:00 2001 From: Tux <34108937+Tux9001@users.noreply.github.com> Date: Sun, 11 Nov 2018 17:47:00 -0500 Subject: [PATCH] added tau based commands I noticed there was commands based on the pi, so I quickly went in and added some for the better circle constant, tau. --- lib/interp/interpreter.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/interp/interpreter.ex b/lib/interp/interpreter.ex index 963a86a..44a3736 100644 --- a/lib/interp/interpreter.ex +++ b/lib/interp/interpreter.ex @@ -71,8 +71,10 @@ defmodule Interp.Interpreter do "žo" -> Stack.push(stack, "ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba") "žp" -> Stack.push(stack, "ZYXWVUTSRQPONMLKJIHGFEDCBA") "žq" -> Stack.push(stack, 3.141592653589793) + "žq̈" -> Stack.push(stack, 6.283185307179586) "žr" -> Stack.push(stack, 2.718281828459045) "žs" -> Stack.push(stack, IntCommands.continued_fraction(fn x -> if x == 0 do 0 else 2 * x - 1 end end, fn y -> if y == 1 do 4 else IntCommands.pow(y - 1, 2) end end)) + "žs̈" -> Stack.push(stack, IntCommands.continued_fraction(fn x -> if x == 0 do 0 else 2 * x - 1 end end, fn y -> if y == 1 do 4 else IntCommands.pow(y - 1, 2) end end)) "žt" -> Stack.push(stack, IntCommands.continued_fraction(fn x -> if x == 0 do 2 else 1 + x end end, fn y -> if y == 0 do 2 else y + 1 end end)) "žu" -> Stack.push(stack, "()<>[]{}") "žv" -> Stack.push(stack, 16)