Coding challenge

Write some code that will plot this polynomial $-x^3 - x^2 + 2 x$ between $x=-3$ and $x=2.$ Find the zeros of this polynomial from your graph. You can make a quick plot like this:
px={}
py={}
k = 0
for x= ??,??,?? do
  px[k] = x
  py[k] = some function of x
  k = k + 1
end
lineplot(px,py)
This fills the arrays px and py with points, so lineplot can plot them.

Type your code here:


Lua reference

See your results here:

Show a friend, family member, or teacher what you've done!

Here is a share link to your code: