#include "vision.h"
#include <iostream>

std::vector<int> _getVisionPattern1d() {
    return {1, 2, 3};
}

int _getMove1d(std::vector<int> v) {
    int Vprime = v[v.size()/2];
    if(Vprime == 1 || Vprime == 2){
        if(v[v.size()-1] < v[0]){
            return v.size()-1;
        }else{
            return 0;
        }
    }
    // Vprime == 3
    if(v[Vprime+1] < v[Vprime-1]){
        return v.size()-1;
    }else{
        return 0;
    }
}

std::vector<int> getVisionPattern1d() {
    return {1, 2, 1, 3, 1, 1};
}

int getMove1d(std::vector<int> v) {
    int Vprime = v[v.size()/2];
    if (Vprime == 2){
        if(v[Vprime+1] > v[Vprime-1]){
            return v.size()-1;
        }else{
            return 0;
        }
    }
    if(Vprime == 3){
        if(v[Vprime-1] > v[Vprime+1]){
            return v.size()-1;
        }else{
            return 0;
        }
    }

    // Vprime == 1
    if(v[0] == v[2]){
        return 2;
    }

    if(v[0] == 3 || v[0] == 2){
        return 0;
    }
    if(v[2] == 3 || v[2] == 2){
        return 2;
    }
    std::cout<<"ne";
    return Vprime;
}
std::vector<std::vector<int>> getVisionPattern2d() {
    return {{1}};
}

std::pair<int, int> getMove2d(std::vector<std::vector<int>> v) {
    return {0, 0};
}
