#include "vision.h"

#include <algorithm>
#include <cassert>
#include <vector>

template<class T> using vec = std::vector<T>;
using ll = long long;

vec<int> getVisionPattern1d() {
  return { 1, 2, 2, 1, 1, 2 };
}

int getMove1d( vec<int> v ) {
  assert( (int)v.size() % 2 == 1 );
  int k = (int)v.size() / 2;
  assert( v[k] == k );

  if( k == 1 ){
    if( v[0] > 1 ) return 0;
    if( v[2] > 1 ) return 2;
  }

  vec<vec<int>> pat2 = {
    { 2, 1, 2, 2, 1 },
    { 1, 2, 2, 1, 1 },
    { 1, 1, 2, 1, 2 }
  };

  if( std::find( pat2.begin(), pat2.end(), v ) == pat2.end() )
    return 0;
  return 4;
}

std::vector<std::vector<int>> getVisionPattern2d()
{
    return {{1}};
}

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