In your C code for ranking games, the create_rand_score function does not use the start argument and relies on s[-1] (i.e. the element located before s in memory), which (I think) can potentially cause an error. Was this intended or did you mean something such as:
int *create_rand_score(int k, int steps)
{
int i;
int *s = malloc(k * sizeof(int));
s[0] = 0
for (i = 1; i < k; ++i)
s[i] = s[i-1] + ((randint(steps) ) + 1);
return s;
}
In your C code for ranking games, the
create_rand_scorefunction does not use thestartargument and relies ons[-1](i.e. the element located beforesin memory), which (I think) can potentially cause an error. Was this intended or did you mean something such as: