mob/verb/Algorithm_Test()
var/x = input("Value of X for the equation","X") as num
var/y = 125*(x^2)-125*x+1000
src << "[y]"
Problem description:
I created the equation 125*(x^2)-125*x+1000 using a program called Graph. The numbers that are suppose to show are as followed:
x=1 than Y=1000
x=2 than y=1250
x=3 than y=1750
x=4 than y=2500
x=5 than y=3500
x=6 than y=4750
x=7 than y=6250
etc
When I put those numbers in however, I get this
x=1 than Y=1250
x=2 than y=750
x=3 than y=750
x=4 than y=1250
x=5 than y=1250
x=6 than y=750
x=7 than y=750
can someone tell me what I am doing wrong?
For "to the power of", you need to use **
so:
x^2 <-- WRONG in BYOND
x**2 <-- CORRECT in BYOND