That particular formula doesn't use perlin noise, it's just a sine wave.
Most of the values are pretty arbitrary, but the general form of the equation is:
https://www.google.com/webhp?sourceid=c ... 0of%20sine
y = amplitude * sin(frequency*x + phase)
amplitude is how high the waves go.
frequency is how close the peaks are.
phase is the initial x offset.
In the formula as I wrote it in the capx.
rnd1, rnd2, rnd3... are just some random numbers I saved. And the Array.curX/40 basically scales it to the array which is 40x30. The other numbers just tweak it a bit.
I used grater than because i wanted to fill in everything below that graph.
As far as an example here's how I would do infinite terrain with perlin noise.
https://dl.dropboxusercontent.com/u/542 ... croll.capx
It matches the "perlin noise with vertical gradient" in that previous capx.
The scrolling is done by covering the screen with the blocks, and disabling/making invisible the blocks that should be clear. Then as the blocks go off the left of the screen they're moved to the right and updated.
The shape of the terrain is defined in the update function. Just by fiddling with the numbers you can get a wide variety of terrain shapes.