diff options
Diffstat (limited to 'gluon.cc')
-rwxr-xr-x | gluon.cc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/gluon.cc b/gluon.cc new file mode 100755 index 0000000..86b78bd --- /dev/null +++ b/gluon.cc @@ -0,0 +1,45 @@ +#include <iostream>
+#include <vector>
+#include <climits>
+#include <cstdlib>
+#include <ctime>
+#include "higgs.h"
+
+using namespace std;
+
+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-1;
+ move.dir = 4;
+ board.doMove( move );
+ exportMove( move );
+ }
+ while( 1 ) {
+ //board.print();
+ board.doMove( importMove() );
+
+ //board.print();
+ vector<Move> move_list = board.generateMoves();
+ move = move_list[ rand() % move_list.size() ];
+ board.doMove( move );
+ exportMove( move );
+ }
+}
\ No newline at end of file |