Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** Find the defect in this code, caused by the "double maintenance" problem */
- // "right-click" is simulated by prefix period character
- boolean rightclick = false;
- if (line.charAt(0) == '.')
- {
- rightclick = true;
- line = line.trim().substring(1,3);
- }
- // parse the move
- char letter = Character.toUpperCase(line.trim().charAt(0));
- int row = letter - 'A';
- String column = line.trim().substring(1, line.length());
- int col = Integer.parseInt(column) - 1; // zero-base
Advertisement
Add Comment
Please, Sign In to add comment