New puzzle from James H: `Bridges', another Nikoli job.
[sgt/puzzles] / net.c
diff --git a/net.c b/net.c
index e205341..f8811a7 100644 (file)
--- a/net.c
+++ b/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;
 
@@ -2753,7 +2746,6 @@ static void draw_diagram(drawing *dr, game_drawstate *ds, int x, int y,
      * Draw each radial line.
      */
     if (drawlines) {
-       print_line_width(dr, thick * 2);
        for (k = 1; k < 16; k *= 2)
            if (v & k) {
                int x1 = min(cx, cx + (r-thick) * X(k));
@@ -2774,7 +2766,7 @@ static void game_print(drawing *dr, game_state *state, int tilesize)
 
     /* Ick: fake up `ds->tilesize' for macro expansion purposes */
     game_drawstate ads, *ds = &ads;
-    ads.tilesize = tilesize;
+    game_set_size(dr, ds, NULL, tilesize);
 
     /*
      * Border.
@@ -2802,7 +2794,6 @@ static void game_print(drawing *dr, game_state *state, int tilesize)
     for (y = 0; y <= h; y++)
        for (x = 0; x <= w; x++) {
            int b = barrier(state, x % w, y % h);
-           fprintf(stderr, "%d,%d: %d\n", x, y, b);
            if (x < w && (b & U))
                draw_rect(dr, WINDOW_OFFSET + TILE_SIZE * x - TILE_SIZE/24,
                          WINDOW_OFFSET + TILE_SIZE * y - TILE_SIZE/24,