TextIO { public static int getSquare(String s) { int x = s.charAt(0) - 'a'; int y = s.charAt(1) - '1'; if ((x < 0) || (x > 7) || (y < 0) || (y > 7)) return -1; return Position.getSquare(x, y); }  static Position readFEN(String fen); static void fixupEPSquare(Position pos); static String toFEN(Position pos); static String moveToString(Position pos, Move move, boolean longForm); static String moveToUCIString(Move m); static Move uciStringToMove(String move); static Move stringToMove(Position pos, String strMove); static int getSquare(String s); static String squareToString(int square); static String asciiBoard(Position pos); static final String startPosFEN; }
@Test public void testGetSquare() throws ChessParseError { System.out.println("getSquare"); assertEquals(Position.getSquare(0, 0), TextIO.getSquare("a1")); assertEquals(Position.getSquare(1, 7), TextIO.getSquare("b8")); assertEquals(Position.getSquare(3, 3), TextIO.getSquare("d4")); assertEquals(Position.getSquare(4, 3), TextIO.getSquare("e4")); assertEquals(Position.getSquare(3, 1), TextIO.getSquare("d2")); assertEquals(Position.getSquare(7, 7), TextIO.getSquare("h8")); }