#include <iostream>
#include <string>
#include <typeinfo>
#include "AtroposBoard.h"
using namespace std;

int main(int argc, char* argv[])
{
	if(argc < 2)
	{
		cout << "Error, no state string entered" << endl;
		return -1;
	}
	else if(argc > 2)
	{
		cout << "Error, too many input arguments" << endl;
		return -1;
	}

	string state;
	int count = 0;
	while(argv[1][count] != NULL)
	{
		state += argv[1][count];
		count++;
	}

	int loc = state.rfind('[');
	count = 0;
	char currChar = state[loc+count+1];
	while(currChar != ']')
	{
		count++;
		currChar = state[loc+count+1];
	}

	AtroposBoard *board = new AtroposBoard(count-1,state);
	board->play();
	cout << board->parseOutState() << endl;
	return 0;
}

