Anyfix Ios Crack

0 views
Skip to first unread message

Lavonna Baldree

unread,
Aug 3, 2024, 3:58:14 PM8/3/24
to letweiviocomp

In prefix notation, the operator comes before the arguments, so you can kind of imagine that the operator calls next() which is recursively called. In infix notation, the operator goes between the arguments, so you can imagine it simply as a parse tree. In postfix notation, the operator comes after the arguments, so you can just imagine it as stack-based.

In anyfix notation, the operator can go anywhere*. If an operator shows up and there aren't enough arguments, then the operator waits until there are enough arguments. For this challenge, you are to implement a very basic anyfix evaluator. (Note that anyfix is a recreational language that I abandoned that you can play around with here or check out here)

Let's take a look at an example: 10+5. The storage should behave as a stack, not a queue. So first, the stack starts at [], and the queued operator list starts at []. Then, the literal 10 is evaluated which makes the stack [10]. Next, the operator + is evaluated, which requires two arguments. However, there is only one argument on the stack, so the queued operator list becomes ['+']. Then, the literal 5 is evaluated which makes the stack [10, 5]. At this point, the operator '+' can be evaluated so it is, making the stack [15] and the queue [].

Let's take a look at a harder example: 10+". The stack and queue start as [] and []. 10 is evaluated first which makes the stack [10]. Next, + is evaluated, which doesn't change the stack (because there are not enough arguments) and makes the queue ['+']. Then, " is evaluated. This can run immediately so it is, making the stack [10, 10]. + can now be evaluated so the stack becomes [20] and the queue []. The final result is [20].

The commands used in these demonstrations are consistent with that of the anyfix language; however, the last example will not work due to a bug in my interpreter. (Disclaimer: Your submissions will not be used in the anyfix interpreter)

Select a set of 5 non-whitespace non-digit characters and create an anyfix interpreter according to the specifications above. Your program can either output the singular array or the value contained by it; it is guaranteed that the stack of values will only contain a single value at the end of execution and that the queue of operators will be empty at the end of execution.

Input will be given as a string and output as an array, a single integer, out the string representation of either. You may assume that the input will only contain spaces, digits, and the 5 characters you choose.

Try it online! Uses the following characters: a for addition, m for multiplication, q for equality, D for duplicate and N for negation. (I wanted to use e for equality, but ran into the problem that lex parses 2e3 as a number.) Example usage: (#([],[])) "2a3 4m" yields 20.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages