I am making basic project for "Computer simulations of polymers and biopolymers" using Monte Carlo simulation and I currently have access only to ASUS eee PC netbook. Could anyone run attached program on a faster hardware for input data 100 50 50 1000000 . Last part of data is number of monte carlo tries, You can set it for example to 10^4 to see how long it would take for larger values. Output for larger values of last parameter are also appreciated. Any suggestions about the code (I know it is hard to read and badly commented with short mixed language variable names) or optimisation options are welcome.
Thank You in advance.

FYI, I launched your program on my home computer (remotely from my office), I will send you the results when I come home later this afternoon.

Here is the solution I got from running it with the parameters you prescribed (100 50 50 1000000).

Thank you very much, they are helpful, although I see that this method needs a lot more time for larger number of segments.