Lines Matching refs:shuffle
1 /* $NetBSD: shuffle.c,v 1.22 2017/02/06 02:26:44 dholland Exp $ */
36 __RCSID("$NetBSD: shuffle.c,v 1.22 2017/02/06 02:26:44 dholland Exp $");
57 * Construct a random shuffle array of t elements
62 size_t *shuffle;
65 shuffle = emalloc(t * sizeof(size_t));
68 shuffle[i] = i;
77 temp = shuffle[j];
78 shuffle[j] = shuffle[k];
79 shuffle[k] = temp;
82 return shuffle;
163 size_t *shuffle = NULL;
203 shuffle = get_shuffle(nlines);
213 printf("%ld", (long)shuffle[i]);
215 printf("%s", lines[shuffle[i]]);