<commit_before>package test.net.zomis.aiscores.ttt;

import static org.junit.Assert.*;

import java.util.Random;

import org.junit.Test;

import net.zomis.aiscores.FieldScoreProducer;
import net.zomis.aiscores.ScoreConfig;
import net.zomis.aiscores.ScoreConfigFactory;
import net.zomis.aiscores.extra.ParamAndField;
import net.zomis.aiscores.extra.ScoreUtils;
import test.net.zomis.aiscores.ttt.SimpleTTT.TTTPlayer;
import test.net.zomis.aiscores.ttt.scorers.CenterScorer;
import test.net.zomis.aiscores.ttt.scorers.CornerScorer;
import test.net.zomis.aiscores.ttt.scorers.CreateTrap;
import test.net.zomis.aiscores.ttt.scorers.OneMissingAnalyzer;
import test.net.zomis.aiscores.ttt.scorers.PreventOppWin;
import test.net.zomis.aiscores.ttt.scorers.WinIfYouCan;

public class TicTacTest {
	private ScoreConfig<SimpleTTT, TTTSquare> x = new ScoreConfigFactory<SimpleTTT, TTTSquare>()
			.withPreScorer(new OneMissingAnalyzer())
			.withScorer(new CenterScorer(), 10)
			.withScorer(new WinIfYouCan(), 5)
			.withScorer(new CornerScorer())
			.withScorer(new CreateTrap())
			.withScorer(new PreventOppWin(), 0.1)
			.build();
	
	private ScoreConfig<SimpleTTT, TTTSquare> o = new ScoreConfigFactory<SimpleTTT, TTTSquare>()
			.withPreScorer(new OneMissingAnalyzer())
			.withScorer(new CenterScorer(), 10)
			.withScorer(new CornerScorer(), -1)
			.withScorer(new PreventOppWin(), 5)
			.withScorer(new WinIfYouCan())
			.build();
	
	
	private SimpleTTT ttt = new SimpleTTT();
	
	private final Random random = new Random();
	
	@Test
	public void testFirstMove() {
		assertFalse(ttt.isWon());
		assertEquals(ttt.getSquare(1, 1), aiPlay());
	}
	
	@Test
	public void fullTest() {
		while (!ttt.isWon()) {
			ttt.output();
			aiPlay();
		}
		ttt.output();
		System.out.println("Winner is " + ttt.determineWinner());
	}
	<commit_msg>Added @Before method and initializing Random to specific seed<commit_after>package test.net.zomis.aiscores.ttt;

import static org.junit.Assert.*;

import java.util.Random;

import org.junit.Before;
import org.junit.Test;

import net.zomis.aiscores.FieldScoreProducer;
import net.zomis.aiscores.ScoreConfig;
import net.zomis.aiscores.ScoreConfigFactory;
import net.zomis.aiscores.extra.ParamAndField;
import net.zomis.aiscores.extra.ScoreUtils;
import test.net.zomis.aiscores.ttt.SimpleTTT.TTTPlayer;
import test.net.zomis.aiscores.ttt.scorers.CenterScorer;
import test.net.zomis.aiscores.ttt.scorers.CornerScorer;
import test.net.zomis.aiscores.ttt.scorers.CreateTrap;
import test.net.zomis.aiscores.ttt.scorers.OneMissingAnalyzer;
import test.net.zomis.aiscores.ttt.scorers.PreventOppWin;
import test.net.zomis.aiscores.ttt.scorers.WinIfYouCan;

public class TicTacTest {
	private final ScoreConfig<SimpleTTT, TTTSquare> x = new ScoreConfigFactory<SimpleTTT, TTTSquare>()
			.withPreScorer(new OneMissingAnalyzer())
			.withScorer(new CenterScorer(), 10)
			.withScorer(new WinIfYouCan(), 5)
			.withScorer(new CornerScorer())
			.withScorer(new CreateTrap())
			.withScorer(new PreventOppWin(), 0.1)
			.build();
	
	private final ScoreConfig<SimpleTTT, TTTSquare> o = new ScoreConfigFactory<SimpleTTT, TTTSquare>()
			.withPreScorer(new OneMissingAnalyzer())
			.withScorer(new CenterScorer(), 10)
			.withScorer(new CornerScorer(), -1)
			.withScorer(new PreventOppWin(), 5)
			.withScorer(new WinIfYouCan())
			.build();
	
	private SimpleTTT ttt;
	private Random random;
	
	@Before
	public void before() {
		ttt = new SimpleTTT();
		random = new Random(42);
	}
	
	@Test
	public void testFirstMove() {
		assertFalse(ttt.isWon());
		assertEquals(ttt.getSquare(1, 1), aiPlay());
	}
	
	@Test
	public void fullTest() {
		while (!ttt.isWon()) {
			ttt.output();
			aiPlay();
		}
		ttt.output();
		System.out.println("Winner is " + ttt.determineWinner());
	}
	
{'fraction_non_alphanumeric': 0.13187103594080338, 'fraction_numerical': 0.006342494714587738, 'mean_word_length': 4.998415213946117, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4438715', 'n_tokens_mistral': 1556, 'n_tokens_neox': 1390, 'n_words': 239}