Trying to simulate Tomas Holy's problem. Unsuccessfully.
1.1 --- a/quoridor/src/test/java/cz/xelfi/quoridor/BoardCase.java Wed Apr 28 23:55:07 2010 +0200
1.2 +++ b/quoridor/src/test/java/cz/xelfi/quoridor/BoardCase.java Sun Jul 18 09:37:40 2010 +0200
1.3 @@ -550,6 +550,73 @@
1.4 Board f = fence(m, 1, 'A', 1, Orientation.VERTICAL);
1.5 Board l = fence(f, 0, 'A', 3, Orientation.VERTICAL);
1.6 }
1.7 +
1.8 + public void testTomasHolyCannotJumpWS() throws Exception {
1.9 +/*
1.10 +N S
1.11 +N S
1.12 +N S
1.13 + */
1.14 + Board b = apply(board, Move.NORTH);
1.15 + b = apply(b, Move.SOUTH);
1.16 + b = apply(b, Move.NORTH);
1.17 + b = apply(b, Move.SOUTH);
1.18 + b = apply(b, Move.NORTH);
1.19 + b = apply(b, Move.SOUTH);
1.20 +/*
1.21 +HD3 HE6
1.22 +HB6 HG3
1.23 +VE3 HD4
1.24 +HA4 VB5
1.25 + */
1.26 + b = fence(b, 0, 'D', 3, Orientation.HORIZONTAL);
1.27 + b = fence(b, 1, 'E', 6, Orientation.HORIZONTAL);
1.28 + b = fence(b, 0, 'B', 6, Orientation.HORIZONTAL);
1.29 + b = fence(b, 1, 'G', 3, Orientation.HORIZONTAL);
1.30 + b = fence(b, 0, 'E', 3, Orientation.VERTICAL);
1.31 + b = fence(b, 1, 'D', 4, Orientation.HORIZONTAL);
1.32 + b = fence(b, 0, 'A', 4, Orientation.HORIZONTAL);
1.33 + b = fence(b, 1, 'B', 5, Orientation.VERTICAL);
1.34 +/*
1.35 +VE1 HC5
1.36 +VE5 HF2
1.37 +VH2 HH1
1.38 +HB3 HF1
1.39 +HA1 S
1.40 + */
1.41 + b = fence(b, 0, 'E', 1, Orientation.VERTICAL);
1.42 + b = fence(b, 1, 'C', 5, Orientation.HORIZONTAL);
1.43 + b = fence(b, 0, 'E', 5, Orientation.VERTICAL);
1.44 + b = fence(b, 1, 'F', 2, Orientation.HORIZONTAL);
1.45 + b = fence(b, 0, 'H', 2, Orientation.VERTICAL);
1.46 + b = fence(b, 1, 'H', 1, Orientation.HORIZONTAL);
1.47 + b = fence(b, 0, 'B', 3, Orientation.HORIZONTAL);
1.48 + b = fence(b, 1, 'F', 1, Orientation.HORIZONTAL);
1.49 + b = fence(b, 0, 'A', 1, Orientation.HORIZONTAL);
1.50 + b = apply(b, Move.SOUTH);
1.51 +
1.52 +/*
1.53 +W W
1.54 +W HC8
1.55 +HC1 HE8
1.56 +N
1.57 +*/
1.58 + b = apply(b, Move.WEST);
1.59 + b = apply(b, Move.WEST);
1.60 + b = apply(b, Move.WEST);
1.61 + b = fence(b, 1, 'C', 8, Orientation.HORIZONTAL);
1.62 + b = fence(b, 0, 'C', 1, Orientation.HORIZONTAL);
1.63 + b = fence(b, 1, 'E', 8, Orientation.HORIZONTAL);
1.64 + b = apply(b, Move.NORTH);
1.65 +/* and now try WS */
1.66 + b = move(b, 1, Direction.WEST, Direction.SOUTH);
1.67 + assertNotNull("Board is OK", b);
1.68 + /*
1.69 + StringWriter sw = new StringWriter();
1.70 + b.write(sw);
1.71 + fail(sw.toString());
1.72 + */
1.73 + }
1.74
1.75 static Board picture2board(String text) throws IOException, IllegalPositionException {
1.76 StringReader sr = new StringReader(text);