mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-22 08:25:45 -07:00
Just noticed a longhand shuffling operation which I must have missed
when I converted them all into calls to shuffle(). [originally from svn r6404]
This commit is contained in:
9
net.c
9
net.c
@ -897,14 +897,7 @@ static void perturb(int w, int h, unsigned char *tiles, int wrapping,
|
||||
perim2 = snewn(nperim, struct xyd);
|
||||
memcpy(perim2, perimeter, nperim * sizeof(struct xyd));
|
||||
/* Shuffle the perimeter, so as to search it without directional bias. */
|
||||
for (i = nperim; --i ;) {
|
||||
int j = random_upto(rs, i+1);
|
||||
struct xyd t;
|
||||
|
||||
t = perim2[j];
|
||||
perim2[j] = perim2[i];
|
||||
perim2[i] = t;
|
||||
}
|
||||
shuffle(perim2, nperim, sizeof(*perim2), rs);
|
||||
for (i = 0; i < nperim; i++) {
|
||||
int x2, y2;
|
||||
|
||||
|
Reference in New Issue
Block a user