+ int left, top, width, height, toleft, totop;
+
+#define L 101
+#define R 102
+#define U 103
+#define D 104
+ static int no_bias[] = { L,L,L,L, R,R,R,R, U,U,U,U, D,D,D,D };
+ static int up_bias[] = { L,L,L,L, R,R,R,R, U,U,U,U, U,U,D,D };
+ static int down_bias[] = { L,L,L,L, R,R,R,R, U,U,D,D, D,D,D,D };
+ static int left_bias[] = { L,L,L,L, L,L,R,R, U,U,U,U, D,D,D,D };
+ static int right_bias[] = { L,L,R,R, R,R,R,R, U,U,U,U, D,D,D,D };
+
+ static int upleft_bias[] = { L,L,L,L, L,R,R,R, U,U,U,U, U,D,D,D };
+ static int downleft_bias[] = { L,L,L,L, L,R,R,R, U,U,U,D, D,D,D,D };
+ static int upright_bias[] = { L,L,L,R, R,R,R,R, U,U,U,U, U,D,D,D };
+ static int downright_bias[] = { L,L,L,R, R,R,R,R, U,U,U,D, D,D,D,D };
+ static int *bias;
+
+ switch (mode) {
+ case SHUFFLE: bias = no_bias; break;
+ case UP: bias = up_bias; break;
+ case LEFT: bias = left_bias; break;
+ case RIGHT: bias = right_bias; break;
+ case DOWN: bias = down_bias; break;
+ case UPLEFT: bias = upleft_bias; break;
+ case DOWNLEFT: bias = downleft_bias; break;
+ case UPRIGHT: bias = upright_bias; break;
+ case DOWNRIGHT: bias = downright_bias; break;
+ case IN: bias = no_bias; break;
+ case OUT: bias = no_bias; break;
+ case MELT: bias = no_bias; break;
+ case STRETCH: bias = no_bias; break;
+ case FUZZ: bias = no_bias; break;
+ default: abort();
+ }