<commit_before>package es.blueberrypancak.chesskurwa;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.Scanner;

public class Stockfish {
	
	private static String bestMove;
	private static char currentSide;
	
	public static void run(String FEN) throws IOException{ 
		bestMove = "";
		currentSide = FEN.split(" ")[1].charAt(0);
		FEN = "position fen " + FEN + "\ngo movetime " + Config.moveTime + "\n";
		Process exe = Runtime.getRuntime().exec(Config.stockfish);
		OutputStream stdin = exe.getOutputStream();
		stdin.write(FEN.getBytes());
		stdin.flush();
		new Thread(new Runnable() {
			public void run() {
				InputStreamReader reader = new InputStreamReader(exe.getInputStream());
				Scanner scan = new Scanner(reader);
				while (scan.hasNextLine()) {
					String s = scan.nextLine();
					System.out.println(s);
					if(s.contains("bestmove")) { 
						bestMove = s.split(" ")[1]; 
					}
				}
				while(exe.isAlive()) { try { scan.close(); exe.getInputStream().close(); } catch (IOException e) { e.printStackTrace(); } exe.destroy(); }
			}
		}).start();
	}
	
	public static String getBestMove() {
		return bestMove;
	}
	
	public static char getCurrentSide() {
		return currentSide;
	}
}
<commit_msg>Moving currentSide inside of the thread<commit_after>package es.blueberrypancak.chesskurwa;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.Scanner;

public class Stockfish {
	
	private static String bestMove, lastFEN;
	private static char currentSide;
	
	public static void run(String FEN) throws IOException{ 
		bestMove = "";
		FEN = lastFEN = "position fen " + FEN + "\ngo movetime " + Config.moveTime + "\n";
		Process exe = Runtime.getRuntime().exec(Config.stockfish);
		OutputStream stdin = exe.getOutputStream();
		stdin.write(FEN.getBytes());
		stdin.flush();
		new Thread(new Runnable() {
			public void run() {
				InputStreamReader reader = new InputStreamReader(exe.getInputStream());
				Scanner scan = new Scanner(reader);
				while (scan.hasNextLine()) {
					String s = scan.nextLine();
					System.out.println(s);
					if(s.contains("bestmove")) { 
						currentSide = lastFEN.split(" ")[3].charAt(0);
						bestMove = s.split(" ")[1]; 
					}
				}
				while(exe.isAlive()) { try { scan.close(); exe.getInputStream().close(); } catch (IOException e) { e.printStackTrace(); } exe.destroy(); }
			}
		}).start();
	}
	
	public static String getBestMove() {
		return bestMove;
	}
	
	public static char getCurrentSide() {
		return currentSide;
	}
}

{'fraction_non_alphanumeric': 0.13790532985464032, 'fraction_numerical': 0.0022363026462914647, 'mean_word_length': 3.308186195826645, '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': '2760357', 'n_tokens_mistral': 965, 'n_tokens_neox': 836, 'n_words': 195}