#include "vision.h"

using namespace std;
std::vector<int> getVisionPattern1d()
{
    return {1,2,4};
}
int getMove1d(std::vector<int> v)
{
    if(v.size()==3)
    {
        if(v[0]==2)
            return 0;
        else return 2;
    }
    else if(v.size()==5)
    {
        if(v[0]==4)
            return 4;
        else return 0;
    }
    else
    {
        if(v[0]==1)
            return 0;
        else return 6;
    }
}

std::vector<std::vector<int>> getVisionPattern2d()
{
    return {{1,2,4},{2,4,1},{4,1,2}};
}
pair<int,int> analiza(int val, vector<pair<int,int>>v1,std::vector<std::vector<int>> v)
{
    for(auto it:v1)
    {
        if(v[it.first][it.second]==val)
        return {it.first,it.second};
    }
}
std::pair<int, int> getMove2d(std::vector<std::vector<int>> v)
{
    if(v.size()==3)
    {
        return analiza(4,{{0,0},{0,6},{6,0},{6,6}},v);
    }
    if(v.size()==5)
    {
        return analiza(4,{{0,0},{0,6},{6,0},{6,6}},v);
    }
    if(v.size()==7)
    {
        return analiza(1,{{0,0},{0,6},{6,0},{6,6}},v);
    }
}

