<commit_before>package org.huajistudio.utils;

import org.huajistudio.api.Board;
import org.huajistudio.api.Chess;
import org.huajistudio.api.ChessObject;

class ChessHelper {
    public static boolean CanMoveTo(ChessObject chess, Board.BoardPos pos, Board board) {
    	ChessObject chessObjectAt = board.chessObjects.get(pos);
    	if (chessObjectAt != null)
    		if (chessObjectAt.side == chess.side)
    			return false;
    	if (chess.type == Chess.PAWN)
    		return true; // TODO special judge
    	return chess.type.getMoves().contains(pos);
    }
}<commit_msg>Special judgement for Pawn movements<commit_after>package org.huajistudio.utils;

import org.huajistudio.api.Board;
import org.huajistudio.api.Chess;
import org.huajistudio.api.ChessObject;

class ChessHelper {

	public static final boolean BLACK = true;
	public static final boolean WHITE = false;

    public static boolean CanMoveTo(ChessObject chess, Board.BoardPos pos, Board board) {
    	ChessObject chessObjectAtDestination = board.chessObjects.get(pos);
    	if (chessObjectAtDestination != null)
		{
			if (chessObjectAtDestination.side == chess.side)
			{
				return false;
			}
		}


		if (chess.type == Chess.PAWN &&
			chess.side==BLACK &&
			chess.pos.y==1 &&
			pos.x==chess.pos.x&&pos.y==3)
		{
			return true;
		}
		if (chess.type == Chess.PAWN &&
			chess.side==WHITE &&
			chess.pos.y==6 &&
			pos.x==chess.pos.x&&pos.y==4)
		{
			return true;
		}

    	return chess.type.getMoves().contains(pos);
    }
}
{'fraction_non_alphanumeric': 0.12382864792503347, 'fraction_numerical': 0.002677376171352075, 'mean_word_length': 3.516616314199396, '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': '6340776', 'n_tokens_mistral': 584, 'n_tokens_neox': 546, 'n_words': 104}