How to make a triangle wave

Google helps:
tri(t) = max(1-|t|,0)