this looks basically correct, I will use another name than "rand" since it's already used in LibC with another meaning (integer values)
another possible intepretation is :
int steps, count;
float newz, alpha, r, part_x=0, part_y=0, part_z=0;
for (count = 0; count < steps; count++)
{
newz...