<commit_before>#include "centercore.h"
#include "assemblyaihelper.h"
#include "QDebug"

CenterCore::CenterCore()
{
}

bool CenterCore::retirement(Gameboard board, int player)
{
    int count = 0;
    for(int x = 3; x <=4; ++x)
    {
        for(int y = 3; y <= 4; ++y)
        {
            if(board.owner(x,y) == player)
            {
                ++count;
            }
        }
    }
    return count >= 3;
}

bool CenterCore::mistrust(float const* const* const vote, Gameboard board, int player)
{
    int count = 0;
    int n = 0;
    for(int x = 0; x < 8; ++x)
    {
        for(int y = 0; y < 8; ++y)
        {
            if(vote[x][y] > 0 && board.play(x,y,player,true))
            {
                ++n;
                Gameboard testboard = board;
                testboard.play(x,y,player,false);
                for(int xi = 2; xi <=5; ++xi)
                {
                    for(int yi = 2; yi <= 5; ++yi)
                    {
                        if(testboard.owner(xi,yi) == player)
                        {
                            ++count;
                        }
                    }
                }
            }
        }
    }
    if(n > 0)
    {
        return (count/n) <= 2;
    }
    else
    {
        return true;
    }
}

void CenterCore::propose(float ** const vote, Gameboard board, int player)
{
    for(int x = 0; x < 8; ++x)
    {
        for(int y = 0; y < 8; ++y)
        {
            if(board.play(x,y,player,true))
            {
                Gameboard testboard = board;
                testboard.play(x,y,player,false);
                int count = 0;
                for(int x_center = 3; x_center <=4; ++x_center)
                {
                    for(int y_center = 3; y_center <= 4; ++y_center)
                    {
                        if(testboard.owner(x_center,y_center) == player)
                        {
                            ++count;
                        }
                    }
                }
                if(count >= 4)
                {
                    vote[x][y] = 1;
                }
                else if(count > 0)
                {
                    vote[x][y] = 1 / (5-count);
                }
            }
        }
    }
    AssemblyAI::ensureOnePossibleMove(vote,board,player);
}

void CenterCore::correct(float ** const vote, Gameboard board, int player)
{
    for(int x = 0; x < 8; ++x)
    {
        for(int y = 0; y < 8; ++y)
        {
            if(vote[x][y] > 0 && board.play(x,y,player,true))
            {
                Gameboard testboard = board;
                testboard.play(x,y,player,false);
                int count = 0;
                for(int x_center = 3; x_center <=4; ++x_center)
                {
                    for(int y_center = 3; y_center <= 4; ++y_center)
                    {
                        if(testboard.owner(x_center,y_center) == player)
                        {
                            ++count;
                        }
                    }
                }
                switch(count)
                {
                case 0:
                    vote[x][y] /= Core::_factorLarge;
                    break;
                case 1:
                    vote[x][y] /= Core::_factorSmall;
                    break;
                case 3:
                    vote[x][y] *= Core::_factorSmall;
                    break;
                case 4:
                    vote[x][y] *= Core::_factorLarge;
                    break;
                default:
                    break;
                }
            }
        }
    }
    AssemblyAI::ensureOnePossibleMove(vote,board,player);
}

QString CenterCore::name() const
{
    return "Center Core";
}
<commit_msg>Deleted unnecessary inclusion of QDebug<commit_after>#include "centercore.h"
#include "assemblyaihelper.h"

CenterCore::CenterCore()
{
}

bool CenterCore::retirement(Gameboard board, int player)
{
    int count = 0;
    for(int x = 3; x <=4; ++x)
    {
        for(int y = 3; y <= 4; ++y)
        {
            if(board.owner(x,y) == player)
            {
                ++count;
            }
        }
    }
    return count >= 3;
}

bool CenterCore::mistrust(float const* const* const vote, Gameboard board, int player)
{
    int count = 0;
    int n = 0;
    for(int x = 0; x < 8; ++x)
    {
        for(int y = 0; y < 8; ++y)
        {
            if(vote[x][y] > 0 && board.play(x,y,player,true))
            {
                ++n;
                Gameboard testboard = board;
                testboard.play(x,y,player,false);
                for(int xi = 2; xi <=5; ++xi)
                {
                    for(int yi = 2; yi <= 5; ++yi)
                    {
                        if(testboard.owner(xi,yi) == player)
                        {
                            ++count;
                        }
                    }
                }
            }
        }
    }
    if(n > 0)
    {
        return (count/n) <= 2;
    }
    else
    {
        return true;
    }
}

void CenterCore::propose(float ** const vote, Gameboard board, int player)
{
    for(int x = 0; x < 8; ++x)
    {
        for(int y = 0; y < 8; ++y)
        {
            if(board.play(x,y,player,true))
            {
                Gameboard testboard = board;
                testboard.play(x,y,player,false);
                int count = 0;
                for(int x_center = 3; x_center <=4; ++x_center)
                {
                    for(int y_center = 3; y_center <= 4; ++y_center)
                    {
                        if(testboard.owner(x_center,y_center) == player)
                        {
                            ++count;
                        }
                    }
                }
                if(count >= 4)
                {
                    vote[x][y] = 1;
                }
                else if(count > 0)
                {
                    vote[x][y] = 1 / (5-count);
                }
            }
        }
    }
    AssemblyAI::ensureOnePossibleMove(vote,board,player);
}

void CenterCore::correct(float ** const vote, Gameboard board, int player)
{
    for(int x = 0; x < 8; ++x)
    {
        for(int y = 0; y < 8; ++y)
        {
            if(vote[x][y] > 0 && board.play(x,y,player,true))
            {
                Gameboard testboard = board;
                testboard.play(x,y,player,false);
                int count = 0;
                for(int x_center = 3; x_center <=4; ++x_center)
                {
                    for(int y_center = 3; y_center <= 4; ++y_center)
                    {
                        if(testboard.owner(x_center,y_center) == player)
                        {
                            ++count;
                        }
                    }
                }
                switch(count)
                {
                case 0:
                    vote[x][y] /= Core::_factorLarge;
                    break;
                case 1:
                    vote[x][y] /= Core::_factorSmall;
                    break;
                case 3:
                    vote[x][y] *= Core::_factorSmall;
                    break;
                case 4:
                    vote[x][y] *= Core::_factorLarge;
                    break;
                default:
                    break;
                }
            }
        }
    }
    AssemblyAI::ensureOnePossibleMove(vote,board,player);
}

QString CenterCore::name() const
{
    return "Center Core";
}

{'fraction_non_alphanumeric': 0.1217982924226254, 'fraction_numerical': 0.012540021344717182, 'mean_word_length': 0.924775353016688, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 15, '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': '3302110', 'n_tokens_mistral': 2345, 'n_tokens_neox': 2137, 'n_words': 444}