Here's something to get you started:
1. for(i=0;i<200;i++)
2. rand();
3. noframes=rand()/200;
Using the above lines
1. FOR i from 0 to 199
DO
2. Get a random number and throw it away
3. Get a random number
Divide it by 200
Store the result in the noframes variable
// etc.