From a7f94036e9b14bde1aaf497e1aa797b41ce6ea3f Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Mon, 27 Apr 2015 11:28:34 +0200 Subject: FINALLY make randino WORK --- randino.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/randino.cpp b/randino.cpp index bb3d917..be5e0f3 100644 --- a/randino.cpp +++ b/randino.cpp @@ -66,8 +66,8 @@ public: } bool isvalid(Move mv){ int oldneuidx=neuidx; - cerr<<"Called isvalid with move "; - protocol_put_move(cerr,mv); + //cerr<<"Called isvalid with move "; + //protocol_put_move(cerr,mv); //print(); if(!move(oldneuidx,mv.neudir)){ //undomove(oldneuidx,mv.neudir); @@ -116,8 +116,8 @@ Move calculate_move(Board &bd){ m.from=fr; m.dir=d; if(bd.isvalid(m)){ - cerr<<"push: "; - protocol_put_move(cerr,m); + //cerr<<"push: "; + //protocol_put_move(cerr,m); poss.push_back(m); } } @@ -138,6 +138,7 @@ Move protocol_get_move(void){ Move m; char c=cin.peek(); if(c=='q'||c=='Q')exit(0); + cin>>m.neudir>>m.from>>m.dir; if(should_flip_board){ m.neudir=flip_dir(m.neudir); m.from=flip_index(m.from); @@ -164,8 +165,8 @@ int main(void){ struct timeval tv; gettimeofday(&tv,NULL); cerr<<"seed="<<(1000000*tv.tv_sec+tv.tv_usec)<