<commit_before>package chessGame;

public class Knight extends ChessPiece {

	private final int score=20;
	private final int rank=2;
	
	public Knight(ChessPlayer player, String position) {
		super(player, position);	
	}
	
	public boolean isValidMove(String moveTo) {
		// TO-DO: add Exception out of the board scope 
		// throw new UnsupportedOperationException();
		// TO-DO: Exception own chess
		
		ChessMonitoringSystem CMS = ChessMonitoringSystem.getInstance();
		if(CMS.getChessPiece(moveTo)==null || 
				CMS.getChessPiece(moveTo).getPlayer()!=this.player)
		{
			int xPosDiff = moveTo.charAt(0)-position.charAt(0);
			int yPosDiff = moveTo.charAt(1)-position.charAt(1);
			if (Math.abs(xPosDiff)==2 && Math.abs(yPosDiff)==1)
				return true;
			else if (Math.abs(xPosDiff)==1 && Math.abs(yPosDiff)==2)
				return true;
		}
		return false;
	}

	public int getScore(){
		return score;
	}

	@Override
	public String toString(){
		if (player.getPlayerId()==1)
			return "N";
		else if (player.getPlayerId()==2)
			return "n";
		else
			return null;
	}

	@Override
	public int getRank() {
		return rank;
	}
}<commit_msg>Update Knight.java<commit_after>package chessGame;

public class Knight extends ChessPiece {

	private final int score=20;
	
	public Knight(ChessPlayer player, String position) {
		super(player, position);	
	}
	
	public boolean isValidMove(String moveTo) {
		// TO-DO: add Exception out of the board scope 
		// throw new UnsupportedOperationException();
		// TO-DO: Exception own chess
		
		ChessMonitoringSystem CMS = ChessMonitoringSystem.getInstance();
		if(CMS.getChessPiece(moveTo)==null || 
				CMS.getChessPiece(moveTo).getPlayer()!=this.player)
		{
			int xPosDiff = moveTo.charAt(0)-position.charAt(0);
			int yPosDiff = moveTo.charAt(1)-position.charAt(1);
			if (Math.abs(xPosDiff)==2 && Math.abs(yPosDiff)==1)
				return true;
			else if (Math.abs(xPosDiff)==1 && Math.abs(yPosDiff)==2)
				return true;
		}
		return false;
	}

	public int getScore(){
		return score;
	}

	@Override
	public String toString(){
		if (player.getPlayerId()==1)
			return "N";
		else if (player.getPlayerId()==2)
			return "n";
		else
			return null;
	}

}
{'fraction_non_alphanumeric': 0.1321971441731921, 'fraction_numerical': 0.011515430677107323, 'mean_word_length': 3.947608200455581, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1061937', 'n_tokens_mistral': 862, 'n_tokens_neox': 754, 'n_words': 175}