#include #include #include #include #include #include "higgs.h" using namespace std; Move random( Board& board ) { vector move_list = board.generateMoves(); if( move_list.size() == 0 ) return {-1,-1,-1}; return move_list[ rand() % move_list.size() ]; } Move importMove() { Move move; cin >> move.ndir >> move.p >> move.dir; return move; } void exportMove( Move move ) { cout << move.ndir << " " << move.p << " " << move.dir << endl; } int main() { Board board; Move move; string input; srand( time( NULL ) ); cin >> input; if( input == "go" ) { //board.print(); move.ndir = -1; move.p = S-2; move.dir = 4; board.doMove( move ); exportMove( move ); } while( 1 ) { //board.print(); board.doMove( importMove() ); //board.print(); move = random( board ); board.doMove( move ); exportMove( move ); } }