Coding challenge

Suppose a particle starts at $x_0=0$ and $y_0=0$. Let it move randomly around, finding the next position $(x_n,y_n)$ from $x_{n+1}=x_n+a$ and $y_{n+1}=y_b+b$, where $a$ and $b$ are each random numbers between -1 and 1. Fill two arrays, one with x-values, and one with y-values up to $n=1000$ and use lineplot to show the resulting path.

Type your code here:


Lua reference

See your results here: