triangle wave



how can i get a triangle wave.

i used these commands ,but i does not work.

f(x):= if x < 0 then -1 else 1;
g(x):= f(sin(x));
z(x):=Integrate(g(x),x);
wxplot2d(g,[x,-10,10],[y,-2,2]);

the error message is :
plot2d: expression evaluates to non-numeric value somewhere in plotting range.

please tell me the correct way.


thanks very much!

thanks very much.



-- 

Wutong Feng