Short description: A start move peg's status would change even if the judge function said it to be invalid. Steps To Reproduce: Choose a peg to be the start move at any turn. Then choose an invalid end move position. Check if the start move peg has its status unchanged. Actual Output: The start move peg changed its status to 0 (empty flag) even if it did not move at all. Expected Output: The start move peg's status would not change.
Previous code: public void giveTips(){ judge_point.setStatus(0); ArrayList<Point> result = new ArrayList<>(); result = new Judge().find(judge_point, g, 0); for (Point point : result) { pArray.add(point); } } Modified code: public void giveTips(){ int prev_status = judge_point.getStatus(); judge_point.setStatus(0); ArrayList<Point> result = new ArrayList<>(); result = new Judge().find(judge_point, g, 0); for (Point point : result) { pArray.add(point); } if(result.isEmpty()) judge_point.setStatus(prev_status); }