
/* Should pass in pointers to the (int *) variables xs,ys,ks, into which
 * will be stored the elements.
 * Parameters: n = number of elements to generate
 *	       w = width of image
 *             h = height of image
 *             K = number of orientation elements
 *             seed = input to random number generator
 * For numbers returned by random() all the bits are usable (notably unlike rand())
 */
random_elements(n, w,h,K, seed)
int n, w,h,K, seed;
{
  int i, xs, ys, ks;	

  srandom(seed);
  for(i=0; i<n ; i++) {
    xs = random() % w + 1;
    ys = random() % h + 1;
    ks = random() % K;
    printf("%2d %2d %2d 1.;\n",xs,ys,ks);
  }
}


main()
{
  random_elements(100,60,60,24,264);
}
