<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TimingTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Random rnd = new Random();

            Console.WriteLine("Timing random games for 3 seconds each.");

            for (uint w=4; w<10; w++)
            {
                for (uint h=4; h<10; h++)
                {
                    uint count = 0;
                    uint b=0, r=0, t=0;
                    var Start = DateTime.Now;
                    do
                    {
                        var game = new Connect4.Board(w, h);
                        while (game.State == Connect4.GameState.InProgress)
                        {
                            List<uint> possible = new List<uint>();
                            for (uint c = 0; c < w; c++)
                                if (game.IsMoveValid(c))
                                    possible.Add(c);
                            game.PlayMove(possible[rnd.Next(possible.Count())]);
                        }
                        count++;
                        switch(game.State)
                        {
                            case Connect4.GameState.BlackWins: b++; break;
                            case Connect4.GameState.RedWins: r++; break;
                            case Connect4.GameState.Tie: t++; break;
                        }
                    } while ((DateTime.Now - Start).TotalSeconds < 3);
                    Console.WriteLine("Playing on a " + w + "x" + h + " board, " + count / 3 + " games per second. Black / Red / Tie: " + b*100/count + "% / " + r*100/count + "% / " + t*100/count + "%");
                }
            }
        }
    }
}<commit_msg>Updated test for more info.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TimingTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Random rnd = new Random();

            Console.WriteLine("Timing random games for 3 seconds each.");

            uint tcount = 0;
            uint tb = 0, tr = 0, tt = 0;

            for (uint w=5; w<10; w++)
            {
                for (uint h=5; h<10; h++)
                {
                    uint count = 0;
                    uint b=0, r=0, t=0;
                    var Start = DateTime.Now;
                    do
                    {
                        var game = new Connect4.Board(w, h);
                        while (game.State == Connect4.GameState.InProgress)
                            game.PlayRandomMove();
                        count++;
                        switch(game.State)
                        {
                            case Connect4.GameState.BlackWins: b++; break;
                            case Connect4.GameState.RedWins: r++; break;
                            case Connect4.GameState.Tie: t++; break;
                        }
                    } while ((DateTime.Now - Start).TotalSeconds < 3);
                    Console.WriteLine("Playing on a " + w + "x" + h + " board, " + count / 3 + " games per second."
                        + "\tBlack / Red / Tie: " + b*100/count + "% / " + r*100/count + "% / " + t*100/count + "%"
                        + "\tFirst move advantage: {0:0.000}", (r>0)?(double)b/(double)r:0);

                    tcount += count;
                    tb += b; tr += r; tt += t;
                }
            }

            Console.WriteLine();
            Console.WriteLine("Out of all the games, played " + tcount / 75 + " games per second."
                + "\tBlack / Red / Tie: " + tb * 100 / tcount + "% / " + tr * 100 / tcount + "% / " + tt * 100 / tcount + "%"
                + "\tFirst move advantage: {0:0.000}", (tr > 0) ? (double)tb / (double)tr : 0);
        }
    }
}
{'fraction_non_alphanumeric': 0.12382881742213218, 'fraction_numerical': 0.021271207900734362, 'mean_word_length': 1.0487551867219918, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '879902', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1021, 'n_words': 264}