How can i generate a random 2d terrain?

i know we can use fractal terrain and particle technique. i have problem with the coding.

how can i displace a point that is located on a sigle line to make it tween to that direction?

problem 2 is using particle generation terrain i generate a terrain with some peak are to obvious. i puzzle how can i collapse the peak.

anyone please help.