What I want:
Take an input, x
Take a formula. It has to be capable of reading something in the format:
- ax^m + bx^n + cx^o ... where m, n, o and any terms after that can represent any value.
- coefficients, again for any number. For example, 6x^2. (That means 6(x^2))
- Doesn't necessarily have to put up with spaces
- times, divide, plus and minus
- brackets - up to stacking of 5
- ANY negative numbers
- To the power of x , these can be integeric (<-- is not a word, but that is the best word I can make up!)
- If x = 5, you can put -x to get -5 and -x^2 is -(x^2). You could use (-x)^2
After it interprets the formula, it has to plug x into the function, then output the value.
- Do it in as less bytes as possible
- The lowest number of bytes wins!
Note: I feel that I have included everything here, but if I haven't please comment below, and I will answer it within the next 30 minutes!
Key: bp = Background Process
- Give me an input, (x)
- Give me a formula:
- (bp) So I have to do 2 to the power of x, which is 2^4, which is 16
- Output: 16