# HG changeset patch # User Jaroslav Tulach # Date 1279438660 -7200 # Node ID ba49bfb120f7b329cf5e23a00993fa5dddf6ac52 # Parent 32dd025e4b767b881ba9c609a5d4e21695a26aa5 Trying to simulate Tomas Holy's problem. Unsuccessfully. diff -r 32dd025e4b76 -r ba49bfb120f7 quoridor/src/test/java/cz/xelfi/quoridor/BoardCase.java --- a/quoridor/src/test/java/cz/xelfi/quoridor/BoardCase.java Wed Apr 28 23:55:07 2010 +0200 +++ b/quoridor/src/test/java/cz/xelfi/quoridor/BoardCase.java Sun Jul 18 09:37:40 2010 +0200 @@ -550,6 +550,73 @@ Board f = fence(m, 1, 'A', 1, Orientation.VERTICAL); Board l = fence(f, 0, 'A', 3, Orientation.VERTICAL); } + + public void testTomasHolyCannotJumpWS() throws Exception { +/* +N S +N S +N S + */ + Board b = apply(board, Move.NORTH); + b = apply(b, Move.SOUTH); + b = apply(b, Move.NORTH); + b = apply(b, Move.SOUTH); + b = apply(b, Move.NORTH); + b = apply(b, Move.SOUTH); +/* +HD3 HE6 +HB6 HG3 +VE3 HD4 +HA4 VB5 + */ + b = fence(b, 0, 'D', 3, Orientation.HORIZONTAL); + b = fence(b, 1, 'E', 6, Orientation.HORIZONTAL); + b = fence(b, 0, 'B', 6, Orientation.HORIZONTAL); + b = fence(b, 1, 'G', 3, Orientation.HORIZONTAL); + b = fence(b, 0, 'E', 3, Orientation.VERTICAL); + b = fence(b, 1, 'D', 4, Orientation.HORIZONTAL); + b = fence(b, 0, 'A', 4, Orientation.HORIZONTAL); + b = fence(b, 1, 'B', 5, Orientation.VERTICAL); +/* +VE1 HC5 +VE5 HF2 +VH2 HH1 +HB3 HF1 +HA1 S + */ + b = fence(b, 0, 'E', 1, Orientation.VERTICAL); + b = fence(b, 1, 'C', 5, Orientation.HORIZONTAL); + b = fence(b, 0, 'E', 5, Orientation.VERTICAL); + b = fence(b, 1, 'F', 2, Orientation.HORIZONTAL); + b = fence(b, 0, 'H', 2, Orientation.VERTICAL); + b = fence(b, 1, 'H', 1, Orientation.HORIZONTAL); + b = fence(b, 0, 'B', 3, Orientation.HORIZONTAL); + b = fence(b, 1, 'F', 1, Orientation.HORIZONTAL); + b = fence(b, 0, 'A', 1, Orientation.HORIZONTAL); + b = apply(b, Move.SOUTH); + +/* +W W +W HC8 +HC1 HE8 +N +*/ + b = apply(b, Move.WEST); + b = apply(b, Move.WEST); + b = apply(b, Move.WEST); + b = fence(b, 1, 'C', 8, Orientation.HORIZONTAL); + b = fence(b, 0, 'C', 1, Orientation.HORIZONTAL); + b = fence(b, 1, 'E', 8, Orientation.HORIZONTAL); + b = apply(b, Move.NORTH); +/* and now try WS */ + b = move(b, 1, Direction.WEST, Direction.SOUTH); + assertNotNull("Board is OK", b); + /* + StringWriter sw = new StringWriter(); + b.write(sw); + fail(sw.toString()); + */ + } static Board picture2board(String text) throws IOException, IllegalPositionException { StringReader sr = new StringReader(text);