Coercionfulity

From Esolang
Jump to navigation Jump to search

Coercionfulity, meaning "something with (much) coercion", is an esolang created by CreeperBomb in 2023. For short, it can also be referred to as "Coer". In it, numbers must be coerced into variables to do almost anything meaningful. Anything number that goes between a quote and an apostrophe (in that order) is replaced with the variable associated with that number. Other than that, Coer is very simple: every line has an ID, a pipe, what gets set, an equals sign, and then what to set it to. "input" & "output" are keywords representing input (decimal, per line) & output (5-adic). The operations are + for addition, - for subtraction, * or x for multiplication, / or ÷ for division,  % or m for moding, ^ or ** for exponentiation, [ ] for flooring, and the previously mentioned coercion. All but the outermost operation used, flooring, & coercion require parenthesis. Note that the "what gets set" doesn't require coercion to specify its a variable, as you won't be setting 1 to 2 while you may set var. 1 to 2. When executing code, the first line of code that's run is line 0 (skipping it if there is no line 0), and from then goes to the line with the smallest ID with a real part greater than the current line's ID (not considering possible change to the ID created by running the line). If there is no such line, the program halts. If there's a tie, one will get picked randomly. Coer uses complex numbers. Variables that haven't been set yet are equal to their name.

Examples

Truth machine:
0 | output = -0.25 x input